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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
cmc099
Frequent Visitor

Measure to find average of areas based on ID

Hi there,

 

I'm having an issue with something that I think should be easy. I have a table that looks something like the following,

 

Unique row IDHouse IDHouse area
11100
21100
32200
42200
52200
6350
73

50

 

What I want to do is create a measure that finds the average area of all houses. The house area is always the same for each row with identical house ids. I essentially want to group the houses by their house ids and only keep one instance of its area, then find the average of these. So, for my example table above, I want my measure to output (100+200+50)/3 = 116.67.

 

I don't want to reduce my table down to just three rows as there are actually way more columns in my actual table that give me different information on the rooms of the house. I have tried calculating using sums and filters but cannot get it to work. I think that within the measure, I'll have to summarize a table that groups all the IDs, then find the average of the area column, but I'm not entirely sure how to do this. Any suggestions? Any help is much appreciated.

1 ACCEPTED SOLUTION

@cmc099 Then use:

Measure = AVERAGEX(DISTINCT(SELECTCOLUMNS('Table',"__ID",[House ID],"__Area",[House Area])),[__Area])


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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Greg_Deckler
Community Champion
Community Champion

@cmc099 Try:

Measure = AVERAGEX(DISTINCT('Table'),[House area])


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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

@Greg_Deckler That still gives me the same issue I've been having unfortunately. The example table I included doesn't include all of the columns that are actually in my table, so every row isn't the exact same even if they share the same House ID, so when I use that measure on my actual table it calculates the mean like, (100+100+200+200+200+50+50)/7, which I don't want, I want to filter by distinct values of the house ID, but I'm not sure how to do this. I've updated the example table with a better view of my actual table now.

@cmc099 Then use:

Measure = AVERAGEX(DISTINCT(SELECTCOLUMNS('Table',"__ID",[House ID],"__Area",[House Area])),[__Area])


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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Yes! Thank you! That works perfectly

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors