Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Power BI Desktop | How can i do a Cumulative Percent Calculation

Hi everyone,   iam struggeling to make a cumulative percent calculation depent "Value" ( "Betrag" in German) for supplier. I have made a percent calculation and it works well, but cumulative perce...
  • v-frfei-msft's avatar
    v-frfei-msft
    7 years ago

    Hi Anonymous ,

     

    To create a calculated column as below.

     

    Table2 = SUMMARIZECOLUMNS('Table'[Supplier],'Table',"value1",SUM('Table'[Value]),"perc",[percent],"id",MAX('Table'[SupplierID]))

    Then add a calculated column in Table2.

     

    rank = RANKX(ALL(Table2),Table2[perc],,DESC,Dense)

     

    After that we can create a measure to get the excepted result as we need.

     

    Measure 2 = CALCULATE(SUM(Table2[perc]),FILTER(ALLSELECTED(Table2),Table2[rank]<=MAX(Table2[rank])))

     

     

    Regards,

    Frank