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 the following data:
I need to calculate the running total of the measure '% of Value Claimed'. So something like this:
49.69%
74.69%
85.84%
89.17% etc
The DAX for the '% Of Value Claimed' measure is:
@Anonymous
You can achieve this by using a combination of RANKX and TOPN.
See this example: this is a simple model calculating the cumulative values for "Actuals" by "Channel"
And here are the measures:
Sum of Actuals = SUM('Data Table'[Actuals])
RankX Actuals =
VAR calc = RANKX(ALLSELECTED('Data Table'[Channel]);[Sum of Actuals];; DESC;Dense)
RETURN
IF(ISINSCOPE('Data Table'[Channel]); calc; BLANK())
And finally the cumulative values:
Cumulative Actuals = SUMX(TOPN([RankX Actuals];
ALLSELECTED( 'Data Table'[Channel]);[Sum of Actuals]; DESC);
[Sum of Actuals])
Proud to be a Super User!
Paul on Linkedin.
Hi @PaulDBrown,
Thanks for your input. Didn't work tho.:
Measures are:
@Anonymous
OK, well try using the sum of values instead of the percentages to get the cumulative, as in:
1) calculate total over all selected :
Total Actuals (selected) = CALCULATE([Sum of Actuals]; ALLSELECTED('Data Table'[Channel]))
2) Rank of values:
RankX Actuals =
VAR calc = RANKX(ALLSELECTED('Data Table'[Channel]);[Sum of Actuals];; DESC;Dense)
RETURN
IF(ISINSCOPE('Data Table'[Channel]); calc; BLANK())
2) Cumulative Values:
Cumulative Actuals = SUMX(TOPN([RankX Actuals];
ALLSELECTED( 'Data Table'[Channel]);[Sum of Actuals]; DESC);
[Sum of Actuals])
3) now divide the cumulative over the total:
Cumulative % Actuals = DIVIDE([Cumulative Actuals]; [Total Actuals (selected)])
And you get this:
Proud to be a Super User!
Paul on Linkedin.
Hi,
You could try creating a running total quick measure and see if you get the result you need
Hi,
The use of the quick measure didn't work (See last column):
The DAX for the Quick measure is:
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 |
---|---|
107 | |
99 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |