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
D_PBI
Post Patron
Post Patron

How to show Top (or Bottom) % or records based on Users filtering?

Hi,
Please view the below simplified table.

D_PBI_3-1680012238251.png


I would like to be able to provide the User three slicer options. Two ('Percent' and 'Top or Bottom') of which will be manually created through the 'Enter Data' method. The third will be the distinct values from the Status field in the table (for the table used in the example (above), the options would be In and Out). See below for a dummy mock-up of the slicers.

D_PBI_1-1680011652112.png


What I would like to do is return a table visual showing the Item No. and Duration (summed) ordered via a ranking method.
For example, let's pretend that 1% percent of the Status = Out records is only three Item No. records. Therefore if the User selected the following slicer options:
Percent = 1.
Top or Bottom = Bottom.
Status = Out.
It would return the below visual:

D_PBI_4-1680012252848.png

 

Notice how only three Item No. records are shown (we're saying that the filtered 1% equals just three records). The Item No. have had their Duration values summed and then are ranked/ordered in ascending order (as the user chose Bottom in the slicer).

How do I acheive this using DAX?  This needs to be done via DAX. I've been following some examples on the next but something is clearly missing as it doesn't work.

If in your response it makes a difference, do be aware the user may choose to see the Top 5% of the records with the In status, or any combination.

Thanks in adavnce.




1 REPLY 1
johnt75
Super User
Super User

SQLBI did a video which I think will help with this - https://www.youtube.com/watch?v=3BAJMlojjVs 

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.