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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
yorick1973
New Member

Getting an average of distinct items for a category/column

How do I get an average for the total of each distinct Item on a list?

Item NameCategoryAge
AClass X2
BClass Y10
CClass Z5
DClass X6
EClass Y2
AClass X4

 

When I do an average of Age by Category, I get the following:

Class X = 4 ((2+6+4)/3 Items)
Class Y = 6 (10+2)/2 Items)
Class Z = 5 (5/1 Item)

I need to show the average per distinct Item.  If an Item has more than one entry, then the total of that Item is to be counted as one entry.  The desired result would be this:
Class X = 6 ((2+6+4)/2 Distinct Items)
Class Y = 6 (10+2)/2 Items)
Class Z = 5 (5/1 Item)

How do I achieve that?

1 ACCEPTED SOLUTION
qqqqqwwwweeerrr
Super User
Super User

Hi @yorick1973 

 

This can be achived by using this dax:

 

average_ = DIVIDE(SUM('Table'[Age]),CALCULATE(DISTINCTCOUNT('Table'[Item Name]),ALLEXCEPT('Table','Table'[Category])))
this waht i am getting as an output
qqqqqwwwweeerrr_0-1717594660496.png

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Check for more intersing solution here: www.youtube.com/@Howtosolveprobem

Regards

View solution in original post

2 REPLIES 2
qqqqqwwwweeerrr
Super User
Super User

Hi @yorick1973 

 

This can be achived by using this dax:

 

average_ = DIVIDE(SUM('Table'[Age]),CALCULATE(DISTINCTCOUNT('Table'[Item Name]),ALLEXCEPT('Table','Table'[Category])))
this waht i am getting as an output
qqqqqwwwweeerrr_0-1717594660496.png

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Check for more intersing solution here: www.youtube.com/@Howtosolveprobem

Regards

Moetazzahran
Resolver II
Resolver II

Measure =
CALCULATE(SUM('Table'[Age])/DISTINCTCOUNT('Table'[Item Name]),ALL('Table'),'Table'[Category]=SELECTEDVALUE('Table'[Category]))
If the solutions answers your problem, pls mark my post as a solution and your Kudos is much appreciated!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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