Sorting date columns in Power BI involves arranging the dates in chronological order, either in ascending or descending order. To achieve this, the date column must be recognized as a date data type. If the column is formatted as text, it will be sorted alphabetically instead of chronologically.
To do this,
- From the visual, there is an unsorted practice visual, starting from April 2024 – September 2024 with other months from 2013 coming in between the month-year axis.
- In order to sort this, you need to create another numeric format of the month and year column of your data.
- To do this, go to the table column by the side of Powerbi environment.
- Click on new column to add an extra column.
- In the formula bar of Powerbi, write a sort formula to sort the date ( 1. Sort = FORMAT(Date), “YYMM” ) and enter to get the numeric format.
- From the values displayed, using the first row, 13 represents the year and 09 represents the month. Same applies to the end.
- Click on the original column we are trying to sort (Month Year Full)
- On the top bar of PowerBi environment, click on sort by column
- A bar will appear, click on sort and the data is sorted
- Back to our graph, the problem has been resolved with the year starting from September 2013 to Dec 2014.
Leave a Reply