Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi all,
I'm having a bit of a headache when trying to sort a graph by month. Normally it's no problem but this time my months are located in different years (some in 2017 and some in 2018). When I have the graph at year level I have no issues, but when I drill down in every year at the same time, the months are sorted wrong.
Does anyone know how to fix this? I have a regular database from excel and can change data type and create extra columns.
Thanks in advance!
You could create a column where you concatenate both year and month like January 2017, February 2017, and so on. Then put an index column. From there you can sort your Month by the index column, which is basically the sequence of the concatenated column of Month and Year. Or you could create a parameter table of months from January to December with index 1 to 12, then connect the months in your data to that table, which is sorted by the index. You could then use the months in the parameter table in your chart.
Hi @Anonymous
This won't work for me, as I have dublicates in my date column and Power BI will not allow me to sort by index, as there are multiple index values for the same date..
But thanks for the input!
Create a column for a month name using something like "FORMAT([Date],"mmm")" to get the month name. Create another one column that is MONTH([Date]). Now sort the month name field by the month number field. Use the month name field in your visual.
That being said, if you are working with a real Date or Date/Time field and using the built-in hierarchy, it should sort the months correctly.
Sample data would help to recreate and it would also help to know how the months are being sorted, alphabetically? Generally if they are being sorted alphabetically you need to create a numeric month field and set your Sort By field to this numeric month column.
Hi Greg - my graphs look like this, where the second one is where I drill into both years at the same time (January, March, April is 2019, rest is 2018). So it seems that the months are being sorted as if all the data were in the same year.
A sample of the date data is below:
Hope you can help 🙂
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 45 | |
| 38 | |
| 34 | |
| 21 | |
| 17 |
| User | Count |
|---|---|
| 66 | |
| 65 | |
| 31 | |
| 26 | |
| 26 |