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.
Good morning,
I have a PBI report where raning and rolling sums are working fine, with about 25K records.
But when my table contains 180K records, then ranking and rolling sums time-out and don't work any more.
I would appreciate so much if you can guide me on solving this issue.
The Data sample and the PBI can be found here:
Thank you so much.
Simon
Solved! Go to Solution.
Here's a solution using calculated columns, but the downside is they don't recognize user selections (e.g., slicer). Thus, the ranking is based on all revenue, not revenue for a specific date range. Running totals in measures can have performance issues as data volume increases.
In the Contact table, create these calculated columns:
Total Revenue = CALCULATE( [_Revenue], RELATEDTABLE ( Sales ) )
Contact Rank = RANKX ( Contact, Contact[Total Revenue],, DESC, Dense )
Revenue Rolling =
VAR vRank = Contact[Contact Rank]
VAR vResult =
CALCULATE (
SUM ( Contact[Total Revenue] ),
ALL ( Contact ),
Contact[Contact Rank] <= vRank
)
RETURN
vResult
Create measure:
_Revenue Rolling = SUM ( Contact[Revenue Rolling] )
Proud to be a Super User!
Hi @y5famfnatudu ,
I need to confirm with you that you want to add up the sums in order according to the ranking order, right? Looking forward to your reply.
Best Regards,
Henry
Hi @v-henryk-mstf ,
Exactly, the ranking is based on the desecnding order of the Revenue.
Best regards,
Simon
I have changed the Ranking DAX formula to the following:
_ContactRank2 :=
RANKX (
ALLSELECTED ( Contact[Debitor Nr] ),
CALCULATE (
SUM ( Sales[Revenue] ),
ALLEXCEPT (
Contact,
Contact[Debitor Nr]
)
)
)
Now, Ranking is working, but the Rolling Sum is still not
Here's a solution using calculated columns, but the downside is they don't recognize user selections (e.g., slicer). Thus, the ranking is based on all revenue, not revenue for a specific date range. Running totals in measures can have performance issues as data volume increases.
In the Contact table, create these calculated columns:
Total Revenue = CALCULATE( [_Revenue], RELATEDTABLE ( Sales ) )
Contact Rank = RANKX ( Contact, Contact[Total Revenue],, DESC, Dense )
Revenue Rolling =
VAR vRank = Contact[Contact Rank]
VAR vResult =
CALCULATE (
SUM ( Contact[Total Revenue] ),
ALL ( Contact ),
Contact[Contact Rank] <= vRank
)
RETURN
vResult
Create measure:
_Revenue Rolling = SUM ( Contact[Revenue Rolling] )
Proud to be a Super User!
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 | |
96 | |
77 | |
63 | |
55 |
User | Count |
---|---|
143 | |
109 | |
89 | |
84 | |
66 |