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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Dan_Sprague
Advocate I
Advocate I

Need help to create a MODE measure on a subset of data

What is the measure to calculate the MODE (value that occurs most often) of duration?

 

My data is like this:

 

salesPersonIDsalesDatesalesDuration
17/5/201930
17/9/201930
17/23/20195
18/10/20195
18/15/20195
18/25/2019100
27/5/201945
27/9/201930
27/23/201930
28/10/2019100
28/15/2019100
28/25/201930

 

The MODE should take into consideration sales person and date.  e.g.:

- If the end user doesn't apply any filters in the dashboard, the measure should produce "30". 

- If the end user sets a filter on sales person #1, the measure should produce "5".

- If the end user sets a filter on August, the measure should produce "100".

- If the end user sets a filter on sales person #1 and August, the measure should produce "5".

 

Thank you much for all guidance!

2 ACCEPTED SOLUTIONS
Greg_Deckler
Super User
Super User

I wrote a Mode Single Column and Mode Multiple Column measure awhile ago:

 

https://community.powerbi.com/t5/forums/searchpage/tab/message?filter=location&q=mode&location=forum...

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


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

View solution in original post

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


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

I wrote a Mode Single Column and Mode Multiple Column measure awhile ago:

 

https://community.powerbi.com/t5/forums/searchpage/tab/message?filter=location&q=mode&location=forum...

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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