Forum Discussion
Sorting by multiple columns
- 7 years ago
You may try using ISONORAFTER Function to add a measure.
Measure = VAR t = SUMMARIZE ( ALLSELECTED ( Table1 ), Table1[Employee], Table1[Training], Table1[Date] ) RETURN COUNTROWS ( FILTER ( t, ISONORAFTER ( Table1[Employee], SELECTEDVALUE ( Table1[Employee] ), DESC, Table1[Training], SELECTEDVALUE ( Table1[Training] ), ASC, Table1[Date], SELECTEDVALUE ( Table1[Date] ), DESC ) ) )
Hi v-chuncz-msft,
Thank you for the prompt reply. That works perfectly! :manhappy:
I was also able to achieve this by adding an Index column in the Power Query as well. But good to learn how to do it in DAX.
Just wondering:
So any data re-ordering / sorting done in PowerQuery is really of no use in any of the visuals.
Do you think this is a bug or by design?
If by design, I am not sure what use it is to sort something in PowerQuery and the sort is not maintained in visuals?
I will mark your answer as solution shortly but just waiting to get some thoughts on the above questions from you ro anyone who might shed some light.
- anandav7 years agoSkilled Sharer
Voted for the idea here:
Now it is wait and see time.
- Anonymous3 years agoNot applicable
Please vote for this idea as well - adding multiple columns sort feature for Matrix table
https://ideas.powerbi.com/ideas/idea/?ideaid=23f41a4f-75c1-ed11-9ac5-501ac5248c97