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
Prasad1
Helper I
Helper I

Using Cumulative Sales Total, Cumulative % values

Hi

 

I have Product Code, Sales Volume Privot report with Sales volumes posted against each SKU across 12 months till Last month. I have to generate running totals at Product code level, calculate each Product code % of Sale, Cumulative % sale to decide ABC analysis for Product code. I unpivot the months and changed into tabular column. And used the 'Table' visual to show the Totals at SKU level. Totals and Average showed correct results. I want to use the 'Quick Measure' or 'New measure' to calculate 'Cumulative Total Sale' and 'Cumulative Sale %' after sorting the Sales Volume column from highest sales to least. It is easy in Excel but couldn't get the same values in Power BI. I am posting the sample Excel sheet and the expected results in excel and also attaching my PowerBI file.

 

Any help is greatly appreciated.

PBIX file on One drive:

https://1drv.ms/u/s!Anl_FYPHVeK9bfgygTQSDGmlA1Y

 

Thanks

Prasad

 

Cumulative Sum & %.JPG

1 ACCEPTED SOLUTION

And here is the measure for Cumulative %age

Cumulative_%age =
CumulativeBI[Cumulative_Total]
    / CALCULATE (
        SUM ( CumulativeBI[Sales Volume] ),
        ALL ( CumulativeBI[Product Code] )
    )

View solution in original post

4 REPLIES 4
Zubair_Muhammad
Community Champion
Community Champion

Hi @Prasad1

 

Here is the measure for Cumulative Total

Cumulative_Total =
VAR Currentsales =
    SUM ( CumulativeBI[Sales Volume] )
RETURN
    SUMX (
        FILTER (
            ALL ( CumulativeBI[Product Code] ),
            CALCULATE ( SUM ( CumulativeBI[Sales Volume] ) ) >= Currentsales
        ),
        CALCULATE ( SUM ( CumulativeBI[Sales Volume] ) )
    )

Add above measure in CumulativeBI table

 

And here is the measure for Cumulative %age

Cumulative_%age =
CumulativeBI[Cumulative_Total]
    / CALCULATE (
        SUM ( CumulativeBI[Sales Volume] ),
        ALL ( CumulativeBI[Product Code] )
    )

Hi Zubair Muhammad

 

Brilliant Solution. Yes. It worked beautifully.

 

Thank you very much for your help.

 

Regards

Prasad

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.