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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
violet11_6
Frequent Visitor

List the Top or Bottom 5 Based on a value

Hi,

 

I have a table with the following fields:

 

Company NameCustomer NameAccounts ReceivableWork-in-progressUnbilled ReceivableTotal ExposureMonth
ACust_AB1000550018008300Month1
BCust_BC20006500280011300Month1
CCust_CD30007500380014300Month1
ACust_AB1050555018508450Month2
BCust_BC20506550285011450Month2
CCust_CD30507550385014450Month2
       

.

I have a card that flags out the month-on-month difference of the various categories eg:

M-o-m variance on Accounts Receivable = +$150

 

of which I need to list the Top or Bottom 5 [Company Name] contributors to the variance, depending on whether the varianceis a positive or negative value. I also need to ignore the zero m-o-m variances. Within the top or bottom 5 [Company Name], I also need to list the top/bottom 5 [Customer name] contributing to the m-o-m variance.

 

Any suggestion on how I can amend the RankX formula to achieve all of the above? 

 

Thanks!

3 REPLIES 3
Anil_kapkoti
New Member

Here is a systematic step-by-step guide to achieve your goal:

Step 1: Create a Table Visual
- Begin by creating a table visual in your chosen power bi, based on your detailed requirements. This table will serve as the starting point for your analysis.

Step 2: Create Required Measures
- Identify the measures you need to calculate and display in your table visual. These measures should represent the metrics or calculations you want to see as the output in the table.

Step 3: Write Final Measure for Card Visual
- Once you have all the measures you need, write a final measure that you want to display in a card visual. This measure will be the primary value you want to emphasize on the card.

Step 4: Create Rank Conditional Measure
- Write a rank conditional measure based on your final measure. This measure will help rank the data in your table visual based on the values of the final measure.

Step 5: Create a Bookmark
- Use your reporting tool's bookmark feature to capture the current state of the report, including the table visual with the rank measure applied. This will save the sorting and filtering settings for the visual.

Step 6: Add Transparency Button
- Insert a transparency button over the card visual that you want to make clickable. This button will be used to apply actions when clicked.

Step 7: Set Up Bookmark Action
- Configure the transparency button to have an action that is triggered when clicked. The action should be set to apply the bookmark you created in Step 5.

Step 8: Populate Account Names
- With the help of the rank measure created in Step 4 and the bookmark action, when the card visual is clicked, it will navigate to the bookmarked table visual with the desired rank applied. This will populate the account names, showing the top 5 or bottom 5 based on the rank measure.

Step 9: Test and Refine
- Test the functionality of the transparency button and the bookmark action to ensure everything is working as expected. Refine the design and settings as needed to achieve the desired outcome.

By following these systematic steps, you can create an interactive report that allows users to click on a card visual, apply the desired action, and populate the account names based on the ranking measure. This will provide an intuitive and user-friendly experience for exploring the data in the report.

violet11_6
Frequent Visitor

Hi,

 

Do you mean set it at the filter? That does not work as I need the list to automatically detect whether to pick from the top or from the bottom. Any suggestion?

rubayatyasmin
Super User
Super User

Use TOPN() or <=5 

 

refer: TOPN function (DAX) - DAX | Microsoft Learn

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.