Forum Discussion

charlottesmn's avatar
charlottesmn
Frequent Visitor
2 years ago
Solved

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...
  • AlphaBravo's avatar
    AlphaBravo
    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.