问题
I have a table Staff Booking
containing Start date
and End Date
for a job. I also have a calculated table filed with
Date Range 2 = CALENDAR(MIN('Staff Booking'[Start Date]), MAX('Staff Booking'[End Date]))
I want to eventually make a relationship between these two table such that:
1) When the date slicer range is defined, the jobs that overlap the slicer are filtered (using the start dat and end date columns)
2) And for the jobs that overlap, if the start date < min(slicer date)
then start date
change to min(slicer date)
回答1:
You can add a measure to the Staff Booking 2 table:
InRange = if(max('Date Range 2'[Date]) >= max('Staff Booking'[Start Date]) && MIN('Date Range 2'[Date]) <= min('Staff Booking'[End Date])),1,0)
As axample I added the InRange measure to the visual but as last step you can filter not on the InRange column by only taking the once which are 1.
来源:https://stackoverflow.com/questions/60943466/table-relationship-to-ensure-table-filters-with-the-date-slicer-when-the-dates-i