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

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.

Reply
bluetronics
Helper III
Helper III

Cummulative Percentage by group

Hello All,

I would like to get the result the same as tabel below:

I can get total by customer, rank and % by Rank. but I donlt know how to get "cummulative % by rank". Pls. instruct me how to get it. Thanks.

CustomersalesTotal by customerRank% by Rankcummulative % by Rank
A10003000150%50%
B200900315%82%
C300600410%92%
D50050058%100%
E10001000217%67%
A20003000150%50%
B700900315%82%
C300600410%92%
Total6000    
1 ACCEPTED SOLUTION
LivioLanzo
Solution Sage
Solution Sage

@bluetronics

 

You can do it like this: 

 

VAR CurSales = CALCULATE( 
                SUM( Data[sales] ), 
                ALLEXCEPT( Data, Data[Customer] ) 
              )
RETURN
DIVIDE(
    CALCULATE(
        SUM( Data[sales] ),
        FILTER(
                ALL( Data[Customer] ),
                CALCULATE( 
                    SUM( Data[sales] ), 
                    ALLEXCEPT( Data, Data[Customer] ) 
                ) >= CurSales
            ),
        ALL( Data )
    ),
    SUM( Data[sales] )
)

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

View solution in original post

5 REPLIES 5
LivioLanzo
Solution Sage
Solution Sage

@bluetronics

 

You can do it like this: 

 

VAR CurSales = CALCULATE( 
                SUM( Data[sales] ), 
                ALLEXCEPT( Data, Data[Customer] ) 
              )
RETURN
DIVIDE(
    CALCULATE(
        SUM( Data[sales] ),
        FILTER(
                ALL( Data[Customer] ),
                CALCULATE( 
                    SUM( Data[sales] ), 
                    ALLEXCEPT( Data, Data[Customer] ) 
                ) >= CurSales
            ),
        ALL( Data )
    ),
    SUM( Data[sales] )
)

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

@LivioLanzo

Thank you for your feedback. I did the script but there is syntex error. Did I something wrong?

Cur slaes.jpg

Hi bluetronics,

 

You should add a column name before the formula.(e.g.:

cummulative % by Rank_ =
VAR CurSales =
......
......

 

Regards,

Jimmy Tao

Thanks a lot! it works. 🙂

bluetronics
Helper III
Helper III

I found the queations what I would like to know. But I still don't understand how to do it.

Pls. help me someboy know the answer.

https://community.powerbi.com/t5/Desktop/Running-total-with-ranking/m-p/323103#M144010

Thanks in advance.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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