表关系,以确保在表中的日期重叠时使用日期切片器过滤表 [英] Table relationship to ensure table filters with the date slicer when the dates in table overlap
问题描述
我有一张 Staff Booking
表,其中包含一份工作的 Start date
和 End Date
.我也有一个计算表提交
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) 定义日期切片器范围后,过滤与切片器重叠的作业(使用开始日期和结束日期列)
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) 对于重叠的工作,如果 start date <min(slicer date)
然后 start date
改为 min(slicer date)
2) And for the jobs that overlap, if the start date < min(slicer date)
then start date
change to min(slicer date)
推荐答案
您可以向 Staff Booking 2 表添加度量:
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)
作为示例,我将 InRange 度量添加到视觉对象,但作为最后一步,您可以不过滤 InRange 列,仅采用 1 的一次.
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.
这篇关于表关系,以确保在表中的日期重叠时使用日期切片器过滤表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!