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
Anonymous
Not applicable

Calculating average of measure

I have a measure similar to this

 

Calc of = 'TableX'[Number of X] / 1000

Here's the idea: 

I have a filter that selects years from 2016-2019. If I select more than one year in the filter the measure above needs to take the average of this and divide it by a thousand. So if the value is 500 for the year 2017 and 200 for the year 2018 the value of the measure should be 

 

Calc of = 350/1000

where 350 is the average of the two numbers. Right now I just get 700/1000. I tried using the AVERAGEX function but it didn't quite work. 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

It's the old average of an average. Try the following. Always  better to use DIVIDE instead of /:

Total Average = AVERAGE( Table1[Value] )
Total Value = Sum( Table1[Value] ) Average = DIVIDE( AVERAGEX( VALUES ( Table1[Year]),[Total Average]), 1000 )

Average of Average.png

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

It's the old average of an average. Try the following. Always  better to use DIVIDE instead of /:

Total Average = AVERAGE( Table1[Value] )
Total Value = Sum( Table1[Value] ) Average = DIVIDE( AVERAGEX( VALUES ( Table1[Year]),[Total Average]), 1000 )

Average of Average.png

Anonymous
Not applicable

Hi @Anonymous probably a bad formulation from my part in the initial message but the "table" is actually a measure, so how does one go about it from that point of view?

Anonymous
Not applicable

I used an alternative (perhaps not so elegant) method where I used DISTINCTCOUNT(TableX[Years]) and multplied it with the denominator. 

Anonymous
Not applicable

I dont follow 100%. If it works for what you need then thats all that matters 🙂

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.