Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
bo_afk
Post Patron
Post Patron

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.

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

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...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@bo_afk Does the above reply helps. if you need more help make me @

Appreciate your Kudos.

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
Anonymous
Not 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

Greg_Deckler
Super User
Super User

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...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.