Forum Discussion

Iamnotarobot's avatar
Iamnotarobot
Regular Visitor
6 years ago
Solved

add average per category lines to chart

Hi everyone,  Is there a way to add average lines per category to line charts?  I know you can add constant lines and an average line, but I want the average per category. Can you put in a meas...
  • Icey's avatar
    6 years ago

    Hi Iamnotarobot ,

    What about this?

    Avg Bob =
    CALCULATE (
        AVERAGE ( 'Table'[Quantity] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Name] = "Bob" )
    )
    
    Avg John =
    CALCULATE (
        AVERAGE ( 'Table'[Quantity] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Name] = "John" )
    )
    
    Avg Mia =
    CALCULATE (
        AVERAGE ( 'Table'[Quantity] ),
        FILTER ( ALL ( 'Table' ), 'Table'[Name] = "Mia" )
    )
    

     

     

    Best Regards,

    Icey

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.