cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
prakash_
Frequent Visitor

Cumulative by rank is very slow in power bi

Hi All,

 

I am trying to calculate cumulative total by rank, my scneriao is I have a metric table where I got "total quantity" and "CM1"as a measure. first I want to rank customer by "CM1" and then based on ranking I want to calculate cumulative total sold quantity.

 

However I have been able to achived this calculation but its taking very long time to load the table visuals, it takes alomost 2 to 5 mins. and that is because in the table it has more than 21 thousand rows.

 

Hers is the measure calcuation - 

Cummulative Total Sold Quantity =
VAR CurrentRank = [Ranking total CM1_]
VAR SummarizeCustomer =
SUMMARIZE(
ALLSELECTED('Customer Parameter_'),'Customer Parameter_'[Customer])
VAR CustomerSales =
ADDCOLUMNS ( SummarizeCustomer, "@Sales", [Total Sold Quantity], "@Rank", [Ranking total CM1_] )
VAR Result =
SUMX ( FILTER ( customerSales, [@Rank] <= CurrentRank ), [@Sales] )
RETURN
Result
 
MeasuresMeasuresTableTable
 
Please help me to reduce the load time or optimize the calculation.
 
Thanks in advance 
1 REPLY 1
v-luwang-msft
Community Support
Community Support

Hi @prakash_ ,

Could you pls share your pbix file and remember to remove confidentail data.

 

 

Best Regards

Lucien

Helpful resources

Announcements
Vote for T-Shirt Design

Power BI T-Shirt Design Challenge 2023

Vote for your favorite t-shirt design now through March 28.

March 2023 Update3

Power BI March 2023 Update

Find out more about the March 2023 update.

March Events 2023A

March 2023 Events

Find out more about the online and in person events happening in March!

Top Solution Authors