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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
2019
Helper II
Helper II

Show 3 highest values based on condition

I have a big table in Power BI where I want to write a DAX Expression to create a new table for each location only to show the 3 highest “losses” values.

 

But sometimes some rows have the same “losses” values therefore I want to show the rows even if they have the same number of “losses” values.

 

For example, if I filter by “location06” and select the highest 3 numbers:

 

ID

Location

Losses

16743

Location06

300

16744

Location06

300

16742

Location06

255

16753

Location06

150

 

But in case the Losses number is repeated then this is what I want to see:

ID

Location

Losses

16743

Location06

300

16744

Location06

300

16742

Location06

255

 

Link to sample datesource file Excel sheet 

2 ACCEPTED SOLUTIONS
ThxAlot
Super User
Super User

Make it more flexible,

ThxAlot_0-1716638009614.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

Try these measures

L = SUM(Data[Losses])
Measure = RANK(DENSE,ALL(Data[ID]),orderby([L],DESC,Data[ID],ASC))

Expand the filter pane and select <=3 as the filter criteria.  Hope this helps.

Ashish_Mathur_0-1716681817462.png

 


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

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

Try these measures

L = SUM(Data[Losses])
Measure = RANK(DENSE,ALL(Data[ID]),orderby([L],DESC,Data[ID],ASC))

Expand the filter pane and select <=3 as the filter criteria.  Hope this helps.

Ashish_Mathur_0-1716681817462.png

 


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

Make it more flexible,

ThxAlot_0-1716638009614.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



danextian
Super User
Super User

Hi @2019 

How about this? The are 2 records each for 300 and 255.

danextian_0-1716626942984.png

 










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


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Please see attached pbix. Visually filter the table to  Show? = 1 or not blank.

danextian_0-1716627949357.png

 










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


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.