Forum Discussion
darko861
Resolver II
2 years agoSelect Correct Date Range in Card
Hi Community, I have the following pbix file. https://www.dropbox.com/scl/fi/30tn682n98oacda3wu4y4/TestData.pbix?rlkey=j3si9f97vgx9i3268tsk5jhhd&dl=0 It's a test dataset with mock values. I ...
- 2 years ago
Hi Guys,
It wasn't as straightforward as one might think, but I managed to tweak the DAX using this measure:
Test =VAR __dt = MAXX(FILTER(ALL(DimDate),DimDate[Latest Date]="Latest"),DimDate[Date])RETURNMAXX(FILTER(VALUES( TrainDate ),TrainDate[startdate] <= __dt && __dt < TrainDate[enddate]),TrainDate[name] & " - " & TrainDate[StartDate] &" - " &TrainDate[EndDate])It works really great now, and the card visual will get updated dynamically as soon as a new test is performed with a different timeframe.
darko861
Resolver II
2 years agoHi Guys,
It wasn't as straightforward as one might think, but I managed to tweak the DAX using this measure:
Test =
VAR __dt = MAXX(FILTER(ALL(DimDate),DimDate[Latest Date]="Latest"),DimDate[Date])
RETURN
MAXX(
FILTER(
VALUES( TrainDate ),
TrainDate[startdate] <= __dt && __dt < TrainDate[enddate]
),TrainDate[name] & " - " & TrainDate[StartDate] &" - " &TrainDate[EndDate])
It works really great now, and the card visual will get updated dynamically as soon as a new test is performed with a different timeframe.