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
DjDon
Frequent Visitor

Average of Count within a group

Hi all,

 

Im looking for a single measure I can place in a card that displays the average number of items in a group category.

 

In the dataset below, I'd like the card to display 3 which is the average count of Item Codes per Office Location.  Item codes are unique.

 

Have tried several variants using GROUPBY but no success.  Thanks for any help!

 

 

Data Looking for overall average:
Office Loc codeOfficeItem Code   Avg Items
OfficeAOffice location AA00025  OfficeA4
OfficeAOffice location AA00049  OfficeB2
OfficeAOffice location AA00073  OfficeC3
OfficeAOffice location AA00193  Overall Average:3
OfficeBOffice Location BA00313    
OfficeBOffice Location BA00385    
OfficeCOffice Location CA00409    
OfficeCOffice Location CA00481    
OfficeCOffice Location CA00505    
1 ACCEPTED SOLUTION
stevedep
Memorable Member
Memorable Member

Hi,

 

pls see below:

Measure = AVERAGEX(VALUES('Table'[Office]), CALCULATE(DISTINCTCOUNT('Table'[Item Code])))

File is attached.

Kind regards, Steve. 

View solution in original post

2 REPLIES 2
stevedep
Memorable Member
Memorable Member

Hi,

 

pls see below:

Measure = AVERAGEX(VALUES('Table'[Office]), CALCULATE(DISTINCTCOUNT('Table'[Item Code])))

File is attached.

Kind regards, Steve. 

That works great - thanks!

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.