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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Anonymous
Not applicable

Average for Unique IDs per category and Total

Hi Community,

I am trying to create a measure that will calculate average for each unique case per category and for total, for the unpivoted table that has one row per category for each case (one case has 5 rows, but only some of those rows are applicable).

 

I would appreciate any guidance to how to achieve this. Currently I have this formula active:

AVERAGEX(SUMMARIZE(table,table[Case ID]),AVERAGE(table[CSAT])))

 

Below is unpivoted Raw data.
Applicable row needs to be used for category based calculation.

Case IDCategoryApplicable RowCSAT
1Wine17
1Beer17
1Spirit07
1Juice07
1Water07
2Wine09
2Beer09
2Spirit19
2Juice09
2Water09
3Wine13
3Beer13
3Spirit13
3Juice13
3Water13
4Wine15
4Beer05
4Spirit05
4Juice05
4Water15
5Wine110
5Beer010
5Spirit010
5Juice110
5Water010

 

 

Here is the output i need. I am able to get either correct calcualtion for category or for total, but not both ion the same visual (Matrix/table).

Categoryavg CSAT
Beer5
Juice6.5
Spirit6
Water4
Wine6.25
Total6.8
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hey

Managed to achieve it with this

Measure = CALCULATE(AVERAGE('Table'[CSAT]),FILTER(SUMMARIZE('Table','Table'[Case ID],"maxi",max('Table'[Applicable Row])),[maxi]=1))
Thanks all who took the time to look into this!!!

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hey

Managed to achieve it with this

Measure = CALCULATE(AVERAGE('Table'[CSAT]),FILTER(SUMMARIZE('Table','Table'[Case ID],"maxi",max('Table'[Applicable Row])),[maxi]=1))
Thanks all who took the time to look into this!!!
amitchandak
Super User
Super User

@Anonymous , Try like

 

 

AVERAGEX(Values(table[Case ID]),calculate(AVERAGE(table[CSAT])))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Hey @amitchandak , thanks for the reply.

Unfortunatelly, it didnt work.

Got total in all rows (as below).

 

Categoryavg CSAT
Beer6.8
Juice6.8
Spirit6.8
Water6.8
Wine6.8
Total6.8

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