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 have been trying to use a measure to calculate a running total. Originally I tried the below expression but as you can see from the matrix snapshot below, the calculation started again at the beginning of the each year.
Cost Forecast (cumulative) =
CALCULATE(
SUMX( 'Programme Resource Planning', 'Programme Resource Planning'[Hours] * 'Programme Resource Planning'[Cost]) * MAX('Fee Factor'[Fee Factor]),
FILTER(
ALLSELECTED('Programme Resource Planning'[Week No]),
ISONORAFTER('Programme Resource Planning'[Week No], MAX('Programme Resource Planning'[Week No]), DESC)),
FILTER(
VALUES('Programme Resource Planning'[Year]),
ISONORAFTER('Programme Resource Planning'[Year], MAX('Programme Resource Planning'[Year]), DESC)))
I managed to overcome this issue with the below formula:
Cost Forecast (cumulative 2) =
CALCULATE(
SUMX( 'Programme Resource Planning', 'Programme Resource Planning'[Hours] * 'Programme Resource Planning'[Cost]) * MAX('Fee Factor'[Fee Factor]),
FILTER(
ALL('Programme Resource Planning'), 'Programme Resource Planning'[Date] <= MAX('Programme Resource Planning'[Date])))
The issue I have now is I can't represent the results as a line graph (see below). The second formula is completely wrong! The first formula is much closer but adds all the values with the same week even if they are from different years. I'm hoping this is simply a case of sorting the hierachy on the x-axis to show both the year and week no but I can't work out how.
Solved! Go to Solution.
Hi @dan_yoxall,
In your scenario, since you have gotten the correct running values via the second measure [Cost Forecast (cumulative 2)], you only need to modify your date hierarchy and chart visual to make it display as you expected.
Please create hierarchy like this:
Then, click the third drill down icon to locate to Year-WeekNo level.
Best regards,
Yuliana Gu
Hi @dan_yoxall,
In your scenario, since you have gotten the correct running values via the second measure [Cost Forecast (cumulative 2)], you only need to modify your date hierarchy and chart visual to make it display as you expected.
Please create hierarchy like this:
Then, click the third drill down icon to locate to Year-WeekNo level.
Best regards,
Yuliana Gu
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 | |
57 |
User | Count |
---|---|
145 | |
111 | |
92 | |
84 | |
66 |