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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Stemar_Aubert
Resolver I
Resolver I

AVERAGEX unexpected behavior.

Hello,

 

I have an issue with AVERAGEX.

 

Using it with a simple table created for testing purposes, I get the following and expected results:

Where "at measure" is a simple SUMX(NUMBER 1 * NUMBER 2).

 

Stemar_Aubert_0-1610117223534.png

"at avg" is -2.92, which is confirmed by Excel, taking the whole "at measure" column and using the AVERAGEX formula.

Slicing also updates the visual and everything is in order.

 

However, when run against another measure, I get this:

Stemar_Aubert_1-1610117414787.png

RepTgtPINSMean is AVERAGEX(Table,Measure), where the Measure is what yields the results of that column.

 

Should be -0.0196, but it gives another result.

The measure is more complex but of similar domain (-x;+x). They are displayed as % but are decimals numbers.

 

So it seems that doing AVERAGEX(Table,Measure), I do not get the AVERAGEX of my more complex measure. My intuition is that context is the culprit here. However not so sure about this. 

 

Thanks for the insights!

 

2 REPLIES 2
v-jingzhang
Community Support
Community Support

Hi @Stemar_Aubert 

 

If your expected result is the arithmetic mean of all the measure values displayed in the column, you could try @parry2k 's solution. 

 

Otherwise if your expected result is not that, it's difficult to tell which would be the cause as we don't know how complex the measure is. I think the logic in the expression is also a possible cause besides the context. You could try calculating the numerator and denominator separately to check whether they are calculated correctly to get what you expect.

 

Kindly let me know if this helps.
Community Support Team _ Jing Zhang
If this post helps, please consider Accept it as the solution to help other members find it.

parry2k
Super User
Super User

@Stemar_Aubert whatever column you are using on the rows (under black color), put that in your measure to get the unique value 

 

AVERAGEX(VALUES(Table[Column]),Measure)

 

Check my latest blog post Year-2020, Pandemic, Power BI and Beyond to get a summary of my favourite Power BI feature releases in 2020

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.