Forum Discussion
Add in average line with filtering
Here's the link where they answered part of the question I am asking:
What I am looking for is to be able to filter these lines so I can see just 1 or multiple at a time. Mainly to compare one group (in my case it is different locations) to the average. With the method above I can't seem to find a way to apply a filter. I have tried another way as well where I add the location data to the legend of the line chart and that easily displays my data and is filterable, but I lose that average line. What is the workaround here? Thank you.
Hi Blake753 ,
Or try this.
Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
9 Replies
- lbendlin
Super User
Usually what you do is show your measure for a selected value, say
Selected = Divide([#DR],[#OP])And then you add the measure for the average across all values regardless of selection
All = CALCULATE(DIVIDE([#DR],[#OP]),all('Fact Table'))- Blake753
Helper II
Can you elaborate on this please? I'm not quite sure what you are saying.
- lbendlin
Super User
When you want to show a particular value AND you want to show the average across all values then you need to modify the filter context to remove your selected filter. That's what the "ALL('Fact Table')" part does in the CALCULATE() statement.
- v-lionel-msft
Community Support
Hi Blake753 ,
Please refer to my .pbix file.
Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Blake753
Helper II
This is an awesome start but the average is changing depending on who is selected in the "CountryRegion" filter. I need that average to remain constant of all entities no matter who is selected to look at. In this case when I select 1 CountryRegion, the "average" is just that number divided by 3.
- Blake753
Helper II
- v-lionel-msft
Community Support
Hi Blake753 ,
Or try this.
Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Blake753
Helper II
Thank you v-lionel-msft. Think this is going to work for me. Thanks to everybody for the help on this one.