Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi
I need to show the current period (start and end date) vs the previous period (start and end date) difference in a single visual.
I've created two date dimensions d1 and d2.
Created proper relationship 1-many with d1, but d2 is un-link(in-active relationship).
I've two slicers like in the below image. 1st slicer is from active date table d1 and 2nd slicer is from in-active data table d2.
Respective min-max dates are shown below image.
How can I get the previous period selected value in a card "test Previous"
here is the measure but showing me a blank value.
test previous =
var minD2 = MIN(DateTable2[Date])
var maxD2 = MAX(DateTable2[Date])
var result =
CALCULATE (
SUM ( 'fact'[amount] )
,FILTER(
'fact',
[date] >= minD2 &&
[date] <= maxD2
)
,ALL(DateTable[Date])
// ,ALL('fact')
)
return result
The pbix file is too big can't attach it here. Need help in Dax only.
Please help me to fix this.
Thanks
Solved! Go to Solution.
Here I go 😉
got the solution, sorry wrong filter was applied.
test previous =
var minD2 = MIN(DateTable2[Date])
var maxD2 = MAX(DateTable2[Date])
var result =
CALCULATE (
SUM ( 'fact'[amount] )
,FILTER(
ALL('DateTable'),
[Date] >= minD2 &&
[Date] <= maxD2
)
)
return result
Here I go 😉
got the solution, sorry wrong filter was applied.
test previous =
var minD2 = MIN(DateTable2[Date])
var maxD2 = MAX(DateTable2[Date])
var result =
CALCULATE (
SUM ( 'fact'[amount] )
,FILTER(
ALL('DateTable'),
[Date] >= minD2 &&
[Date] <= maxD2
)
)
return result
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
100 | |
76 | |
74 | |
49 |
User | Count |
---|---|
146 | |
108 | |
106 | |
90 | |
62 |