Forum Discussion
Tricky Sort
- 5 years ago
That's too vague, without understanding what exactly you want to achieve I cannot give a solution.
The index added in Power Query will sort the table in the given order, the fact that a specific columns will also be sorted is just a consequence. This is the way to go if you need the sort for the calculations in M. Also this doesn't impact the table sorting in DAX layer at all.
In the DAX layer the sorting can happen in two levels:1) in a visual, where e.g. all entries for '20 April 2021' will be grouped to reflect the number of items shown for that date, if that's what you want to sort then you just need custom index per date in the order you expect and use sort by column
2) in the table view, but that doesn't have any implications for the measure/column calculations or visuals, so I doubt this is what you're looking for
I would add an index column after the data was pasted, then you use it for sorting purposes and remove afterwards
Hi Stachu, try thats but i have multiple date values.....
- Stachu5 years agoCommunity Champion
ok, one step back - do you want to sort in Power Query or in the model?
- Anonymous5 years agoNot applicable
Either which method works...
- Stachu5 years agoCommunity Champion
That's too vague, without understanding what exactly you want to achieve I cannot give a solution.
The index added in Power Query will sort the table in the given order, the fact that a specific columns will also be sorted is just a consequence. This is the way to go if you need the sort for the calculations in M. Also this doesn't impact the table sorting in DAX layer at all.
In the DAX layer the sorting can happen in two levels:1) in a visual, where e.g. all entries for '20 April 2021' will be grouped to reflect the number of items shown for that date, if that's what you want to sort then you just need custom index per date in the order you expect and use sort by column
2) in the table view, but that doesn't have any implications for the measure/column calculations or visuals, so I doubt this is what you're looking for