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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
asalazarjr
Frequent Visitor

Cumulative % of Total Measure

Hey All,

Was wondering if anyone could help me create a measure to dynamically calculate Cumulative % of Total Revenue.

ProductTotal RevenueProduct Rank% of TotalCumulative % of Total
Product 1 $        100,000130%30%
Product 2 $          75,000223%53%
Product 3 $          50,000315%68%
Product 4 $          25,00048%76%
Product 5 $          20,00056%82%
Product 6 $          18,00065%87%
Product 7 $          15,00075%92%
Product 8 $          10,00083%95%
Product 9 $            9,00093%98%
Product 10 $            8,000102%100%
Total $        330,0001100%100%


I created this measure:

Cumulative % of Revenue =
VAR SalesRT= Calculate(SUM(Table1[Revenue]),FILTER(
ALLSELECTED(Table1[Product]),
ISONORAFTER(Table1[Product],MAX(Table1[Product]),DESC)))
VAR totSales= CALCULATE(SUM(Table1[Revenue]),ALLSELECTED(Table1))

Return
Divide(SalesRT,totSales,0)
This measure worked, but its returning Cumulative % of Total based on Default table sorting, and not by Revenue rank. If anyone has any idea how to alter this, or a different measure that would be greatly appreciated!

Thanks in advance!


1 ACCEPTED SOLUTION
AlexisOlson
Super User
Super User

You need to sort by Total Revenue rather than by product.

 

Try this:

Cumulative % of Revenue =
VAR MinRevenue = MINX ( VALUES ( Table1[Product] ), [Total Revenue] )
VAR SalesRT =
    CALCULATE (
        SUM ( Table1[Revenue] ),
        FILTER ( ALLSELECTED ( Table1[Product] ), [Total Revenue] >= MinRevenue )
    )
VAR totSales = CALCULATE ( SUM ( Table1[Revenue] ), ALLSELECTED ( Table1 ) )
RETURN
    DIVIDE ( SalesRT, totSales, 0 )

View solution in original post

1 REPLY 1
AlexisOlson
Super User
Super User

You need to sort by Total Revenue rather than by product.

 

Try this:

Cumulative % of Revenue =
VAR MinRevenue = MINX ( VALUES ( Table1[Product] ), [Total Revenue] )
VAR SalesRT =
    CALCULATE (
        SUM ( Table1[Revenue] ),
        FILTER ( ALLSELECTED ( Table1[Product] ), [Total Revenue] >= MinRevenue )
    )
VAR totSales = CALCULATE ( SUM ( Table1[Revenue] ), ALLSELECTED ( Table1 ) )
RETURN
    DIVIDE ( SalesRT, totSales, 0 )

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! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.