Forum Discussion
anandav
7 years agoSkilled Sharer
Sorting by multiple columns
Hi Experts, I have the following data. Employee Training Date Greg Training 1 19/09/2017 Bill Training 1 19/09/2017 Joe Training 1 19/09/2017 David Training 1 19/09/2017 ...
- 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 ) ) )
anandav
7 years agoSkilled Sharer
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.
v-chuncz-msft
7 years agoCommunity Support