返回给定 2 个不同日期切片器的值差 [英] Return Difference of Value Given 2 Different Date Slicers
问题描述
我有 2 个日期切片器和一个 [Profit] 测量值,我想返回给定日期选择的利润差异.详情请看下文.
I have 2 date slicers and a measurement which is [Profit], I would like to return the difference in Profit given the date selections. Please see below for detail.
- 日期切片器 1:2021 年 3 月 7 日-2021 年 3 月 13 日
- 日期切片器 2:2021 年 3 月 14 日-2021 年 3 月 20 日
- Profit given Date Slicer 1:10
- Profit given Date Slicer 2: 15
- 我试图获得的值 = 5 (15-10)
推荐答案
如果两个切片器来自同一个 Date 列,则两个句点不会相互交叉,您会得到一个没有日期的过滤器.
If the two slicers come from the same Date column, both periods do not intersect each other and you get a filter without dates.
可能有更好的解决方案,但其中之一是使用 Harvester 过滤器(创建一个包含与模型无关的日期列副本的附加表,即断开连接的表)
Possibly there are better solutions but one of them would be to use a Harvester Filter (Creating an additional table containing a copy of the date column unrelated to the model, aka Disconnected Tables)
在继续下一部分之前,您可以验证过滤器是否包含相同的日期,但由于它是一个断开连接的表,它还没有过滤模型
Before moving on to the next part you can verify that the filter contains the same dates but since it is a disconnected table, it does not filter the model, yet
对于 [Profit given Date Slicer 1],您可以使用原始度量
For the [Profit given Date Slicer 1] you can use the original measure
对于 [Profit given Date Slicer 2],您必须将过滤器更改为:
For the [Profit given Date Slicer 2] you must change the filter to:
DATESBETWEEN(
'Dates'[Date],
MIN(HarvestingDates[Date]),
MAX(HarvestingDates[Date])
)
这篇关于返回给定 2 个不同日期切片器的值差的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!