Forum Discussion
charlottesmn
2 years agoFrequent Visitor
Dynamic Top N based on column ordering
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 numb...
- 2 years ago
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.
Sergii24
2 years agoSuper User
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!