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
olimilo
Responsive Resident
Responsive Resident

Problem with getting the Top 5 entries

I've been trying to follow the examples on the forums, but I'm getting the incorrect output when trying to get the Top 5 Entries in my column.

 

Given the following data:

 

something.png

 

I would like to get the top 5 results from the table. I tried the following formulas:

 

[Measure] Violation Ranking = RANKX(ALL(Violation_Data), COUNTA(Violation_Data[Violation]))

[Column] Top Violations = IF([Violation Ranking] > 5, "Others", Violation_Data[Violation])

 

But I'm still getting all of the results from [Violation] (I think it has something to do with the Calculated Column). I tried using a Visual Filter instead (show only [Violation Ranking] <= 5), but I'm still getting the same results (the [Violation Ranking] of each [Violation] is 1 (which is odd, to say the least) that's why all of the violations are displayed.

 

Anyone know how to correct the given DAX code?

1 ACCEPTED SOLUTION
olimilo
Responsive Resident
Responsive Resident

Okay, so I think I got it. I was able to use Visual Filters to select just the top 5 most recurrent Violations in the table like so:

 

BhdsW

View solution in original post

1 REPLY 1
olimilo
Responsive Resident
Responsive Resident

Okay, so I think I got it. I was able to use Visual Filters to select just the top 5 most recurrent Violations in the table like so:

 

BhdsW

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.