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.
I need help how to create measure that ignore (evaluation context dates) dates in between context dates.
The goal is to create a visual where date is context 2 year / month. We need to show month value and cumulative value.
DataTable:
Measure:
GM Total = VAR LastRD = MAX( DATA[ReportDate] ) //Last Report Date VAR LastSD = MAX( 'Calendar'[Date] ) //Last Context Date RETURN IF ( LastSD > LastRD; CALCULATE( SUM(DATA[Value]); FILTER( ALL('Calendar'); 'Calendar'[Date] <= LastRD) ); BLANK() )
Please help with the measure on how to fill the blanks (Ref. RED values). We tried the TOTALYTD works but does not sum cumulative over years. Appreciate your help.
Solved! Go to Solution.
Hi @gselvag,
Please change your formula like below.
GM Total = VAR LastRD = MAX ( DATA[ReportDate] ) //Last Report Date VAR LastSD = MAX ( 'Calendar'[Date] ) //Last Context Date RETURN IF ( LastSD > LastRD, CALCULATE ( SUM ( DATA[Value] ), FILTER ( ALL ( 'Calendar' ), 'Calendar'[Date] <= MAX ( 'Calendar'[Date] ) ) ) )
Then you could get your desired output.
In addition, you also could use TOTALYTD like with formula below.
YTD = TOTALYTD(SUM(Data[Value]),DATESYTD('Calendar'[Date]))
Best Regards,
Cherry
Hi @gselvag,
Please change your formula like below.
GM Total = VAR LastRD = MAX ( DATA[ReportDate] ) //Last Report Date VAR LastSD = MAX ( 'Calendar'[Date] ) //Last Context Date RETURN IF ( LastSD > LastRD, CALCULATE ( SUM ( DATA[Value] ), FILTER ( ALL ( 'Calendar' ), 'Calendar'[Date] <= MAX ( 'Calendar'[Date] ) ) ) )
Then you could get your desired output.
In addition, you also could use TOTALYTD like with formula below.
YTD = TOTALYTD(SUM(Data[Value]),DATESYTD('Calendar'[Date]))
Best Regards,
Cherry
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |