Forum Discussion

sfink22's avatar
sfink22
Helper I
7 years ago
Solved

Weighted average table calculation

Hello! Trying to build what I had assumed was a simple table that is proving much more difficult. My source table is project & team data that looks something like this:   Category     Team 1   Team...
  • Vvelarde's avatar
    7 years ago

    sfink22 

     

    Hi, try with this:

     

    Step 1: Unpivot Data

        Go to Query Editor Select the Category Column and Unpivot Other Columns -- Close & Apply

    Step 2: Create a measure:

     

    WeightedAverage = 
    VAR _SumValues=SUM(Table1[Value])
    VAR _TeamTotal=CALCULATE(SUM(Table1[Value]),ALL(Table1[Category]))
    VAR _Total=CALCULATE(SUM(Table1[Value]),ALL(Table1))
    
    RETURN
    DIVIDE(_TeamTotal ,_Total) * _SumValues

    Step3 : Use in a matrix visual

     

     

     

     

    Regards

     

    Victor