Forum Discussion

Mist's avatar
Mist
Frequent Visitor
10 years ago
Solved

Plot a filtered value compared to an average across unfiltered values

Let's say I have monthy sales data for a few companies over one year. I want to plot the average sales across all companies. Easy right! Then I want to add one companies sales to the same plot to all...
  • Mist's avatar
    Mist
    10 years ago

    Here's how I solved it. Instead of separate measures for each company I just created one measure that's the result of the highlighted company:

    SalesSelected = CALCULATE(AVERAGE([sales]), ALLSELECTED(sales[company]))

    The average line is the same as chrisu suggested:

    AvgSales = CALCULATE(AVERAGE([sales]), ALL(sales[company]))

    Thanks chrisu for puting me on the right track.