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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

Create a measure that displays only top 20 customer names based on another measure's value

I'm stumped in trying to create a measure that displays only the customer names based on the total number of open issues associated with the customer.

 

Eventually, I would like to pass this measure to a slicer to show the top 20 customers.

 

I have a measure that calculates the total number of customer issues that are open:

 

Customer Open Issues = 
COUNTROWS (
    ( FILTER ( 'CustomerIssue', 'pbi CustomerIssue'[Status] = "Open")))

 

I believe I have two options, using RANK or TOPN.

 

I have created the rank function, but I believe that would force me to use a table and I don't want to do that (I want to use a slicer).

 

I am not sure how I can use TOPN to show only customer names while I'm taking the TOPN of a measure. My guess was to use a Calculated Table.

 

Has anyone run into this scenario?

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

Hi

You can create a Rank measure and then use it as a visual filter to get top 20 customers

View solution in original post

2 REPLIES 2
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

TOPN returns a static calculated table as result. It cannot be dynamically changed based on slicer selection.

 

For your requirement, you should create a rank measure. Also, you need an extra table to list all available TopN items like below. Add this column into slicer. This table should be unrelated with your source data table..

1.PNG

 

Then, create a measure and add it to visual level filter, set its value to 1.

Check=IF([Rank]<=MAX(TOPNTable[TopN selection]),1,0)

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Zubair_Muhammad
Community Champion
Community Champion

Hi

You can create a Rank measure and then use it as a visual filter to get top 20 customers

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.