Forum Discussion

blueshell's avatar
blueshell
New Member
6 years ago
Solved

Weighted average line chart instead of simple average

 

Currently in the analytics pane of the visual, we can show simple average line on line chart. However, I want a line that represent the weighted average instead of the simple average. Is it possible to do?

We do  weighted average in almost every chart we generate, wish Power BI has this funtion built in...

 

below is the data:

Month Sales Score sale x score 
January         949,8007          6,648,600
January         458,40010          4,584,000
January         903,8006          5,422,800
February      1,135,8008          9,086,400
February         505,8004          2,023,200
February      1,503,1008       12,024,800
March      1,607,6005          8,038,000
March      1,288,9007          9,022,300
March         250,0009          2,250,000

 

I like the line chart show  "weighted average score" dynamicly...

Monthaverage score weighted average score 
January                7.67                      7.20
February                6.67                      7.36
March                7.00                      6.14

 

Thanks!

  • parry2k's avatar
    parry2k
    6 years ago

    blueshell should be easy, try following

     

    Add new column

     

    Sales x Score = Table[Sales] * Table[Score]

     

    Add following measure for Avg

     

    Weighted Avg = 
    DIVIDE ( SUM ( Table[Sales] ), SUM ( Table[Salex x Score] ) )

     

5 Replies

      • parry2k's avatar
        parry2k
        Icon for Super User rankSuper User

        blueshell should be easy, try following

         

        Add new column

         

        Sales x Score = Table[Sales] * Table[Score]

         

        Add following measure for Avg

         

        Weighted Avg = 
        DIVIDE ( SUM ( Table[Sales] ), SUM ( Table[Salex x Score] ) )

         

  • How can we bring in a "Weighted Average" measure into a line or bubble chart?