Forum Discussion
Power BI | Dynamic Sorting Based on User Selection
- Anonymous1 year ago
You can try to create two tables to store [Tender Name] and the rankings based on two different date columns, and use field parameters to switch the sorting.
1. Create two tables using the following DAX:
ITT_TenderRanks = ADDCOLUMNS( DISTINCT('Table'[Tender Name]), "ITT Rank", RANKX(ALL('Table'), CALCULATE(MAX('Table'[ITE Forecast Date])), , ASC, Dense) )PQQ_TenderRanks = ADDCOLUMNS( DISTINCT('Table'[Tender Name]), "PQQ Rank", RANKX(ALL('Table'), CALCULATE(MAX('Table'[PQQ Forecast Date])), , ASC, Dense) )2. Set the [Tender Name] column in both tables to be sorted by the ranked column:
3. Create a one-to-many unidirectional relationship between these two tables and the Forecast table:
4. Select the [Tender Name] field in both tables to create the field parameter:
5. Create a slicer with the field parameter and replace the [Tender Name] field with the field parameter in the matrix visual.
Best Regards,
Jarvis Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
You can achieve this using bookmarks and button combination
- AkashGhinmine1 year agoNew Member
Hey mh2587 ,
Apologies for my mistake, I gave the wrong visual Screenshot. Unfortunately, I don't think bookmarks would work in this case becausse those date fields will not be a part of the visual. The idea would be to sort specific column [Tender Name] by the dates dynamically. I assume bookmarks would work only when we have those fields present in the visual.Thanks,
Akash