Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello!
I have a table with customers and a couple of different metrics (number of orders, number of items bought, number of connections, total spent...). By default, the table is ordered by the number of orders. I would like to limit the table to show only the top 50 customers. However, I want the top 50 to update if the user decides to order the table by a different column. I know I can use the TOP N feature but I was not able to make this feature update based on the column chosen for the table ordering?
Thank you!
Solved! Go to Solution.
To make the TOP N filter dynamic based on the column selected by the user, you can create a dynamic slicer using a What-If Parameter:
1. Create a slicer table that contains all the headers of the columns you want to filter into one column.
2. Create a measure that uses the RANKX function to rank the values based on the selected column.
3. Use the slicer to filter the values based on the selected column.
The TOP N filter will update dynamically based on the column chosen for ordering by the user.
Hi @charlottesmn ,
Did the above suggestions help with your scenario? if that is the case, you can consider Kudo or Accept the helpful suggestions to help others who faced similar requirements.
If these also don't help, please share more detailed information and description to help us clarify your scenario to test.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
Hi @charlottesmn, take a look at this video which shows how exactly you can achieve the desired result! Even if it's not fully dynamic as you still need to hardcode selection values in DAX, it can be very useful in your further research.
Good luck!
To use the TOP N feature in Power BI, build your visual as usual. Then, click on the visual and open the filters pane. Add or select the filter you want to apply the TOP N filter to, in this case, the ‘Customers’ filter. Select TOP N, choose whether to show top or bottom items, and enter the number of items to show, which in this case is 50.
The crucial part is the ‘By value’ section. This is what determines what the top or bottom 50 are based on. Drop the related column in this section and click apply. Power BI will automatically pick a calculation for you, such as sum or count, but you can change this.
For example, you can choose it to be a SUM of Value delivered or a COUNT of instances delivered, depending on your data.
Note that the TOP N filter won't update dynamically if the user decides to order the table by a different column. It will always be based on the column you selected when setting up the filter.
Thank you for the quick response. Is there any way to make the TOP N update based on the column the user selects?
To make the TOP N filter dynamic based on the column selected by the user, you can create a dynamic slicer using a What-If Parameter:
1. Create a slicer table that contains all the headers of the columns you want to filter into one column.
2. Create a measure that uses the RANKX function to rank the values based on the selected column.
3. Use the slicer to filter the values based on the selected column.
The TOP N filter will update dynamically based on the column chosen for ordering by the user.
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
114 | |
95 | |
90 | |
35 | |
35 |
User | Count |
---|---|
154 | |
102 | |
82 | |
64 | |
54 |