Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Manish1005
Regular Visitor

Cumulative sum is not recalculating based on sort my measure Sales

Current table visual
Table:Sales

ItemSalesSales%Comulative SumComulative %
A500031.06%500031.06%
B200012.42%700043.48%
C300018.63%1000062.11%
D600037.27%1600099.38%
E1000.62%16100100.00%
Total16100100.00%16100100%

 

Current logic i used in above table:

 

Sales = sum(Sales[Sales Amount])

Comulative Sales =calculate(sum(Sales[sales Amount]),filter(allselected('Sales'),

                             Sales[Sales Amount]<=MAX(Sales[Sales Amount])

 

Total Sales Amount=calculate(sum(Sales[Sales Amount]),allselected(Sales))

 

Comulative % = Divide(Comulative Sum, Tital Sales Amount)

 

When Calculated measure Sales mount Sort by Desc then Comulative sum could be recalculate order by

ItemSum(Sales Amount)Sales%Comulative SumComulative %
D600037.27%600037.27%
A500031.06%1100068.32%
C300018.63%1400086.96%
B200012.42%1600099.38%
E1000.62%16100100.00%
Total16100100.00%16100100%

 

 

Thanks in Advance!

1 REPLY 1
lbendlin
Super User
Super User

don't use MAX inside CALCULATE.  Mind the filter context transition.  Use variables.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.