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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
SusuYes
Helper III
Helper III

Calculating the Mode and Median for Non-numeric data

Hello everyone, 

I have data on the number of staff who attended certain workshops. I have calculated the average number of attendance to every workshop type. However, I want to calculate the mode and the mean as well.

 

My data is stored as follows: 

Workshop TypeStaff ID Attended
Type A1111
Type B3333
Type A4444
Type A5555
Type C2222

 

I have tried using the formulas on this page however I cannot seem to get a result. 

I am hoping to get the following:

  • For every workshop type, what is the mode of staff attended? 
  • For every workshop type, what is the median nuber of staff attended?

 

Any help or guidance is appreciated. 

7 REPLIES 7
Ashish_Mathur
Super User
Super User

Hi,

Write these measures.  Based on that data that you have shared, please share the exact values that you are expecting of the Mode.

Attendees = SUM(Data[Staff ID Attended])
Median = MEDIANX(VALUES(Data[Staff ID Attended]),[Attendees])

Hope this helps.

Untitled.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hello Ashish, thanks for your suggestion but unfortunatly my Staff ID coloumn is stored as a string so I cannot sum it. Any idea how to get across that? 

You are welcome.  In which case, is your question even relevant?  I thought arithmatic functions (specially Median and Mode) work only on numeric columns.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hello Ashish, I am hoping to report on the number of attendees to each workshop type and finding the median, mean, and mode of the attendance for each workshop type. 


Would using a count for Attendees serve the same purpose? 

Just show the exact result you are expecting.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@SusuYes , Try like

 

Medianx(Values(Table[Workshop Type]), calculate(Count(Table[Staff ID])) )

 

 

Averagex(Values(Table[Workshop Type]), calculate(Count(Table[Staff ID])) )

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

Hello @amitchandak

 

thanks for your response. I tried the above formulas but for the Medianx I got the result back to be 1 which is not quite right. I am expecting to know for each workshop type, what is the median value of the number of staff that attended. 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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