Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Calculated value using Pareto principle

I would like to use the pareto principle to calculate how many users amount for a certain precentage of a total sum and I can't seem to get it working. I've vaccumed the forum and found many articles...
  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi Ville,

     

    Firstly you would need a ranking column. The simplest would be to do this in your query editor since it is a built in function (Add column/Index column). Rank your Sales column in descending order when doing this.

     

    Create a measure

     

     

    mCumulativePerc = 
    
    VAR vTotal = 
        CALCULATE(
            SUM('Table'[Sales]),
            ALLSELECTED('Table')
        )
    
    VAR vCumulativeSum =
        CALCULATE(
            SUM('Table'[Sales]),
            FILTER(
                ALLSELECTED('Sales'),
                'Table'[Index] <= MAX('Table'[Index])
            )
        )
    
    VAR vCumulativePerc =
        DIVIDE(
            vCumulativeSum,
            vTotal
        )
    
    RETURN
        vCumulativePerc

     

     

    And call it in a calculated column

     

     

    Cumulative Percentage = [mCumulativePerc]

     

     

    As for only looking at a certain range, you can use a slicer and use the calculated column as your field.

     

    Hope you found this useful

     

    Regards,

    AndreM