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 am running into issues with cumulative totals and was wondering if anyone else has solved this issue:
I am trying to create a chart which shows the cumulative total for the selected perioed, the target for the selected period, and the cumulative PY total for the selected period. I can get it all to work except for the PY cumulative total.
Here is a chart to illustrate my progress and problem.
The cumulative total that works (the green line) uses this DAX Expression:
Order Net YTD (G) =
VAR EndDate =
MAX ( DIM_DATE_TABLE[Date] )
VAR CumulativeTotalCY =
CALCULATE (
SUM ( SalesFact[Net Value] ),
FILTER (
ALLSELECTED ( DIM_DATE_TABLE ),
DIM_DATE_TABLE[Date] <= EndDate
)
)
RETURN
IF (
MAX ( DIM_DATE_TABLE[Date] ) <= [Date of Most Recent Data],
CumulativeTotalCY,
BLANK ()
)
And the little black squigly line at the bottom of the chart is the one that is broken. I can't get it to be a cumulative total of the prior year.
That dax expression is simply
Solved! Go to Solution.
hi, @Gensetter
For your case, you could use this formula to add a PY measure
Measure 3 = CALCULATE(CALCULATE( [Order Net YTD (G)] , SAMEPERIODLASTYEAR(DIM_DATE_TABLE[Date])), FILTER ( ALLSELECTED ( DIM_DATE_TABLE ), DIM_DATE_TABLE[Date] <= MAX(DIM_DATE_TABLE[Date]) ))
Result:
Best Regards,
Lin
hi, @Gensetter
For your case, you could use this formula to add a PY measure
Measure 3 = CALCULATE(CALCULATE( [Order Net YTD (G)] , SAMEPERIODLASTYEAR(DIM_DATE_TABLE[Date])), FILTER ( ALLSELECTED ( DIM_DATE_TABLE ), DIM_DATE_TABLE[Date] <= MAX(DIM_DATE_TABLE[Date]) ))
Result:
Best Regards,
Lin
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 |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |