表关系,以确保在表中的日期重叠时使用日期切片器过滤表

编程入门 行业动态 更新时间:2024-10-23 12:32:27
本文介绍了表关系,以确保在表中的日期重叠时使用日期切片器过滤表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一张 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.

更多推荐

表关系,以确保在表中的日期重叠时使用日期切片器过滤表

本文发布于:2023-10-30 19:23:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1543768.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:日期   切片   关系   以确保

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!