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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
matdel
Helper I
Helper I

Average X

Hello

I'm trying to do a control chart by using the lines graphic.

For that I need to add on the graphic a constant line that will be the average of all my results from the column Result of my tab.

So I have done this measure : 

AVERAGE RESULT = CALCULATE(AVERAGEX('Quality control results','Quality control results'[Result]),ALLSELECTED('Quality control'[Result]))

RM LIMS - Power BI Desktop.jpg

But it doesn't work, as I don't have a constant line : it's doign the same graphic as if I had only put the column "Result" in the value of the graphic in fact .

 

Thank you for your help!

 

 

1 ACCEPTED SOLUTION

HI @matdel ,

 

In that case you can modify your average caluclation DAX as follows:

AVERAGE RESULT = CALCULATE(AVERAGE('Quality control results'[Result]), ALL('Quality control'))

 

You don't have to use AVERAGEX to achieve this. Because it evaluates an expression for each row. You need a single average value for your RESULT column therefore you need to use AVERAGE.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

4 REPLIES 4
Pragati11
Super User
Super User

HI @matdel ,

 

You can simply add a average line using the Analytics Pane feature on a Line chart visual. You don't need a calculation for it. See an example below:

Pragati11_0-1619167124277.png

 

Thanks,

Pragati

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Yes, thanks, but actually after I need also to calculate UCL and LCL from the average, to put them on the graphic also

STDEV RESULT = CALCULATE(STDEV.P('Quality control results'[Result]),ALLSELECTED('Quality control results'[Result]))
UCL RESULT = [AVERAGE RESULT]+3*[STDEV RESULT]
LCL RESULT = [AVERAGE RESULT]-3*[STDEV RESULT]

 

HI @matdel ,

 

In that case you can modify your average caluclation DAX as follows:

AVERAGE RESULT = CALCULATE(AVERAGE('Quality control results'[Result]), ALL('Quality control'))

 

You don't have to use AVERAGEX to achieve this. Because it evaluates an expression for each row. You need a single average value for your RESULT column therefore you need to use AVERAGE.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Thank you!! it works 🙂

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.