Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Tricky Sort

Hi Experts   My Dates column in a certain table has mulitple dates - i want to sort the data how is was copy and pasted into the table (enter data) in Power Query. Date Column 20 April 2021 20 A...
  • Stachu's avatar
    Stachu
    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