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.
I am stuck with similar situation, can anyone please provide solution