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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join 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
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

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.