Forum Discussion
Average line for legend values
I have a line graph which displays conversion rate for two categories (A and B) with week number on the x axis. I have a legend on the graph so the rate for the two categories are displayed separately as two lines.
Is it possible to add an average line for each of the category values?
When I add an average line using the Analytics function, it takes the average value for both categories as a single line.
Sure, just create two measures like:
Average A = AVERAGEX(FILTER(ALL('Table'),[Category]="A"),[Value]) Average B = AVERAGEX(FILTER(ALL('Table'),[Category]="B"),[Value])Add these to your Line Chart Values area. Specifics for you may vary, Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
3 Replies
- Greg_Deckler
Community Champion
Sure, just create two measures like:
Average A = AVERAGEX(FILTER(ALL('Table'),[Category]="A"),[Value]) Average B = AVERAGEX(FILTER(ALL('Table'),[Category]="B"),[Value])Add these to your Line Chart Values area. Specifics for you may vary, Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
- amitchandak
Super User
bo_afk Does the above reply helps. if you need more help make me @
Appreciate your Kudos.- AnonymousNot applicable
Hi amitchandak ,
I have same issue as original poster, but solution above is not working for me. I am able to create the averages measures, but when I try to add these into the 'values' area of my graph, it replaces the existing lines instead of adding my averages lines on top. I understand this is because my graph has a legend, which means only one thing is allowed in the 'values' area. Do you have any advice for this scenario?
Thanks much,
Grey