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! Learn more

Reply
Pillz
Frequent Visitor

Find Average for another column

Hi,

I'm trying to find the average of event attendees for each category. Example: average for Category 1 would be 19.5 (15+24/2)

Attached is an example of the table data that I have right now.

How would I go abouts calculating the average

Thanks 

 

Pillz_1-1596123375494.png

 

1 ACCEPTED SOLUTION

Hi @Pillz,

 

Given your Data Model I think the following will work

 

% By Category = 
var numerator = CALCULATE(COUNTROWS('Data'), ALLEXCEPT('Data','Data'[Category]))
var denominator =  CALCULATE(COUNTROWS(SUMMARIZE(ALLEXCEPT(Data, 'Table'[Event Category]), Data[Event], "m", COUNTROWS(Data))))
 return 
divide(numerator,denominator)

Hope this Helps

Richard 


Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


View solution in original post

9 REPLIES 9
richbenmintz
Resident Rockstar
Resident Rockstar

Hi @Pillz 

 

I think this Measure will work for you

 

 

 

% By Category = 
var numerator = CALCULATE(SUM('Table'[Attendees]), ALLEXCEPT('Table','Table'[Event Category]))
var denominator =  CALCULATE(COUNTROWS('Table'), ALLEXCEPT('Table','Table'[Event Category]))
 return 
 DIVIDE(numerator,denominator)

 

 

 

 

 

Hope this helps,

 

Richard


Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

 



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


amitchandak
Super User
Super User

@Pillz , In case you need column

avergageX(filter(Table,[event category] = earlier([event category])),[attendees])

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
jdbuchanan71
Super User
Super User

Write a measure like this

Avg Attendees = AVERAGE ( YourTable[Attendees] )

Then add your [Event Category] and the measure to a matrix visual.

Thanks for the response,

Actually the attendee column is just a COUNT of Table[Attendee Name] rather than a hard number value. Would that change the approach of my problem?

@Pillz 

Please share the layout of your data model so we can understand the tables involved and also any measures you are using and how they are getting calculated.

@jdbuchanan71 
Here's the model I'm working with

Pillz_0-1596124291093.png
I currently have no measures but in my table right now, the column values are

Event Name, Count of Attendee Name, Event Category 

Pillz_1-1596124431494.png

 



 

Thank you.

First, make your count into a measure:

Attendee Count = DISTINCTCOUNT ( Data[Attendee Name] )

Then you can write the average measure like so.

Avg Attendees = AVERAGEX ( VALUES ( Data[Category]), [Attendee Count] )

 

@jdbuchanan71 

Seems like Avg Attendees gives me the same result as Attendee Count. I revamped my table so that the each event has a total sum of attendees rather than the count of attendees for that event.

I think it is because the way my table was setup originally that caused me some confusion

 

Hi @Pillz,

 

Given your Data Model I think the following will work

 

% By Category = 
var numerator = CALCULATE(COUNTROWS('Data'), ALLEXCEPT('Data','Data'[Category]))
var denominator =  CALCULATE(COUNTROWS(SUMMARIZE(ALLEXCEPT(Data, 'Table'[Event Category]), Data[Event], "m", COUNTROWS(Data))))
 return 
divide(numerator,denominator)

Hope this Helps

Richard 


Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!



I hope this helps,
Richard

Did I answer your question? Mark my post as a solution! Kudos Appreciated!

Proud to be a Super User!


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.

Top Solution Authors