Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Get It Sorted!
Sort One Column by Another Column
Work on a report this week had me solve a sort order issue.
The column chart visual had MONTH_YEAR on the x-axis from the date table - e.g. "Apr-2022" - very common, very easy to read and understand.
Thing was, the sort order wasn't right. Turned out the MONTH_YEAR column was sorted based on the MONTH_YEAR_NUM column (i.e. 42022). It did sort correctly, but wasn’t what I wanted or needed.
In Power Query, I created a new column - YEAR_MONTH_NUM (i.e. 20224). The order/sequence of the digits made a BIG difference - year first then month. It was better, but still not right.
The final key to the puzzle was to ensure the month numbers were all TWO digits - 202204. NOW everything was good and worked the way I needed AND wanted!
When you sort one column in a table by another column(s), make sure the values in those columns are what you need to get the sort order you desire.
Hi, @cmengel
I'm glad you solved the sorting problem by yourself. If you are willing to share your case specifically, or summarize your solutions in one sentence and reply below, you can mark your answer as solution to help the other members find it more quickly.
Best Regards,
Community Support Team _ Janey
User | Count |
---|---|
99 | |
86 | |
78 | |
75 | |
71 |
User | Count |
---|---|
112 | |
105 | |
96 | |
74 | |
66 |