Forum Discussion

Happy2023_05's avatar
Happy2023_05
Icon for Helper I rankHelper I
3 years ago
Solved

Two Average/Mean Lines in Power BI

Hi, In scatter plot,I need to create 2 average lines one line should be static and other line should not change. For eg suppose Us has avg sales of 50 k this should be static and other avg line shou...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Happy2023_05 ,

    To create two average lines in a scatter plot, one static and one dynamic, you can use the following steps:

    1. Create a measure for the static average.

    Static Average = AVERAGE(Table[Sales])

    2. Create a measure for the dynamic average line.

    Dynamic Average =
    CALCULATE ( AVERAGE ( Table[Sales] ), ALLEXCEPT ( Table, Table[State] ) )
    

    3. Add both measures to the values section of the scatter plot. You can change their color, transparency, line style, and position.

    4. Add a slicer for the state column to your report. When you select a state from the slicer, the dynamic average line will change accordingly, but the static average line will remain constant.

     

    How to Get Your Question Answered Quickly 

     

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

     

    Best Regards
    Community Support Team _ Rongtie

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