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'm trying to do a Running Total based on a rank of a measure.
After a little of research i've found the way to do the running total but i'm having a trouble with that.
I create a rank measure:
Ranking City = RANKX(ALL(Sales[City]),[QTR Quantity],,DESC,Skip)
And a measure for the running total:
Running Total = CALCULATE ( [QTR Quantity], ( TOPN ( [Ranking City], ALL ( Sales[City] ), [QTR Quantity] ) ))
The problem is when a pair of cities have the same rank (a tie situation) the running total sum the value of both cities in the same row / point (when it's a chart).
Example:
I think the solution is try to change the ranking so when there's a tie it should put different ranking for each member.
Thanks!
Solved! Go to Solution.
Finnally i´ve got the solution.
I´ve changed the approach of the formula.
Used this guide (it´s in spanish)
Hi @chsardas
Could you try this?
Running Total = CALCULATE ( [QTR Quantity], ( TOPN ( [Ranking City], ALL ( Sales[City] ), [QTR Quantity] + RANDBETWEEN ( 1, 100 ) / 1000 ) ) )
Thanks for your reply!.
Now it only sum one of the members which are tied.
But the behavior i expect is cardenas shoud be 11.511 + 515 and COMALCALCO should be 12.026 + 515.
HI @chsardas
Instead of Running_Total try doing this for Ranking City
The idea is to differentiate between 2 similar Ranks by decimal points. You can hide the decimals for RANKING
Ranking City = RANKX ( ALL ( Sales[City] ), [QTR Quantity],, DESC, SKIP ) + RANDBETWEEN ( 1, 100 ) / 1000
Nice idea, now the ranking shows different values:
But the running total keeps returning the same, it looks like the top n doesn't take care of the decimal. 😞
HI @chsardas
Sorry I went to sleep.
Could you try this please?
I hope it will work
Ranking City = RANKX ( ALL ( Sales[City] ), [QTR Quantity] + RANDBETWEEN ( 1, 100 ) / 1000, , DESC, SKIP )
Hi!! Now the ranking works better but the running total is really weird:
I've sent you a PM.
Finnally i´ve got the solution.
I´ve changed the approach of the formula.
Used this guide (it´s in spanish)
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 | |
100 | |
78 | |
64 | |
58 |
User | Count |
---|---|
148 | |
113 | |
97 | |
84 | |
67 |