Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
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, while retaining the original conversion rate lines also?
When I add an average line using the Analytics function, it takes the average value for both categories as a single line. When I create averages measures for each category, I am not able to add these to the values area of the graph because it will replace the original conversion rate lines.
A similar question was asked recently but did not address how to get the averages lines on the same graph as the original conversion rate lines.
Solved! Go to Solution.
Hi @Anonymous ,
When using a legend on a line chart (or any other type) the calcuations of the average is based on the all the data an not one for each of the categories of the legend.
In this case you need to create 4 measures 2 for the convertions rates A and B and another for the averages A and B.
Don't know what type of aggregaiton you are using on your model but you can use something similar to this:
Measure A = CALCULATE(SUM(Table[Column]); Table[Category]= "A")
Measure B = CALCULATE(SUM(Table[Column]); Table[Category]= "B")
Average A = AVERAGEX(ALL(Table[Week]); [Measure A])
Average B = AVERAGEX(ALL(Table[Week]); [Measure B])
Be aware that the average values can be calculated in other ways and not only on the averagex but is just a way.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @Anonymous ,
When using a legend on a line chart (or any other type) the calcuations of the average is based on the all the data an not one for each of the categories of the legend.
In this case you need to create 4 measures 2 for the convertions rates A and B and another for the averages A and B.
Don't know what type of aggregaiton you are using on your model but you can use something similar to this:
Measure A = CALCULATE(SUM(Table[Column]); Table[Category]= "A")
Measure B = CALCULATE(SUM(Table[Column]); Table[Category]= "B")
Average A = AVERAGEX(ALL(Table[Week]); [Measure A])
Average B = AVERAGEX(ALL(Table[Week]); [Measure B])
Be aware that the average values can be calculated in other ways and not only on the averagex but is just a way.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsAdvance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.