gpt4 book ai didi

How to filter dates before or equal a selected value in a segment w/o using date slicer in PowerBI(如何使用PowerBI中的日期切片器在不带日期的段中筛选早于或等于选定值的日期)

转载 作者:bug小助手 更新时间:2023-10-24 18:40:08 24 4
gpt4 key购买 nike



I have a visual in PowerBI showing values by quarter and I want to show only the quarter that are before or equal to the selected date in a segment, how to do that ?

我在PowerBI中有一个按季度显示值的视觉效果,我想只显示某个分段中早于或等于所选日期的季度,该如何操作?


When I use the segment the interaction on the other visuals filter only on the equal selection. I want the dates filtered before or equal the selection. I don't want to use the date silder because I want the selection to be only by quarter and not on a specific date.

当我使用片段时,其他视觉上的交互只在相等的选择上过滤。我希望在选择之前过滤日期或等于所选日期。我不想使用日期白银,因为我希望选择只按季度,而不是在特定的日期。


Below is a screenshot of what I'm looking for :

以下是我正在寻找的内容的截图:


(i) it shows the current behavior based on the selection

(I)它显示基于选择的当前行为


(ii) it shows what I would like to do

(Ii)它表明我想做什么


see what I expected to do

看看我想要做什么


This is my model (I have two data tables related to one date table)

这是我的模型(我有两个数据表与一个日期表相关)


see my model

看我的模特


I tried this query but it doesn't work

我尝试了这个查询,但它不起作用


Total Numbers =
CALCULATE(
SUM('T_Data_1'[Numbers]),
FILTER(
T_Data_1,
T_Data_1[Date] <= MAX(T_Dates[TrimestreDate])
)
)

I also tried Dynamic Parameter M but I'm not using Direct Query so I wasn't able to bind the paramater and my report will be published on PowerBI Report Server that doesn't support the feature.

我还尝试了动态参数M,但我没有使用Direct Query,因此无法绑定该参数,并且我的报告将发布在不支持该功能的PowerBI Report Server上。


更多回答
优秀答案推荐

Like this?

是像这样吗?


Total Numbers =
CALCULATE(
SUM('T_Data_1'[Numbers]),
FILTER(
ALL([T_Data_1[Date]),
T_Data_1[Date] <= MAX(T_Dates[TrimestreDate])
)
)


Someone found the solution from another forum so I share it here:

有人从另一个论坛找到了解决方案,所以我在这里分享:


It requires to create an additional date table independant from the others. I created this independant table based on the first date table so I have the same threashold:

它需要创建一个独立于其他日期表的附加日期表。我在第一个日期表的基础上创建了这个独立表,因此我有相同的想法:


T_Dates_Ind = GENERATE (
DISTINCT(T_Dates[TrimestreDate]),
VAR trimestreDate = [TrimestreDate]
VAR year =
YEAR ( trimestreDate )
VAR quarterMiddle =
CONCATENATE("Trim ",QUARTER(trimestreDate))
RETURN
ROW (
"Année, Trim", year & " " & quarterMiddle
))

I keep it with no relation and then I can get the selected date to use it as value to filter the measure:

我将其保留为无关联,然后我可以获取所选日期,以将其用作筛选度量的值:


Total Numbers To Selected Quarter = 
VAR _max = MAXX(ALLSELECTED(T_Dates_Ind),T_Dates_Ind[TrimestreDate])
VAR _min = DATE(YEAR(_max)-1,MONTH(_max),DAY(_max))
RETURN
CALCULATE(SUM(T_Data_1[Numbers]), FILTER(T_Dates, T_Dates[Date] <= _max && T_Dates[Date] >= _min))

Link to the video the guy shared: https://www.youtube.com/watch?v=44fGGmg9fHI

该男子分享的视频链接:https://www.youtube.com/watch?v=44fGGmg9fHI


更多回答

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com