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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.