Forum Discussion

AlexXandyr's avatar
AlexXandyr
Icon for Helper I rankHelper I
3 years ago

Cumulative % for customers

Hello everyone,

 

Im trying to create a cumulative % measure on my data (yellow highlighted column). 

- % to total is based on column $ by using "percent of grand total" on my $ measure

- I want to create this cumulative % in E-column that is based on company and percentages in D-column.

But I cant figure out how to do this? 

 

 

 

 

2 Replies

  • Hi,

    Please check the below picture and the attached pbix file.

     

    Value measure: = 
    SUM( Data[Value] )

     

    Percentage to total: = 
    VAR _total =
        CALCULATE ( [Value measure:], ALL ( Data[Company], Data[PartyCode] ) )
    RETURN
        DIVIDE ( [Value measure:], _total )
    

     

    Percentage cumulate: = 
    VAR _total =
        CALCULATE ( [Value measure:], ALL ( Data[Company], Data[PartyCode] ) )
    VAR _valuecumulate =
        CALCULATE (
            [Value measure:],
            WINDOW (
                1,
                ABS,
                0,
                REL,
                ALL ( Data[Company], Data[PartyCode] ),
                ORDERBY ( [Value measure:], DESC )
            )
        )
    RETURN
        DIVIDE ( _valuecumulate, _total )
    

     

  • Thank you for the quick response. The measure for percentage to total worked fine, however after created the Percentage cumulate I get an error message saying "visual has exceeded the available resources". My data set is roughly 2.7 million rows.