Forum Discussion
Sorting month order in line chart
- 5 years ago
hi Dunner2020
In edit queries, add a costom column as below:
if [Month Of Year]>=4 then ([Year]*100)+[Month Of Year]-3 else ([Year]-1)*100+[Month Of Year]+9Now use this custom column to sort by column
Result:
and here is sample pbix file, please try it.
Regards,
Lin
Hi Dunner2020
you have to have a column with month number. Sort the month name by this column.
With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)
Hi FrankAT ,
I created the Month number column (starting from April) and sorted out but no luck:
After the sort still looks the same
- amitchandak6 years ago
Super User
Dunner2020 , if it is month
Months Like Jan /Feb or January
Then you should mark the Month number as the sort column
If the month is like MMM-YYYY or MMMM-YYYY
then you need have sort column like
Month Year Sort= format([Date],"YYYYMM")
and mark this as sort column. refer steps at https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column
- Dunner20206 years ago
Post Prodigy
amitchandak , I created a new sort column as you mentioned in the reply. It sort out the values in data view as shown in the picture:
However, it did not sort out the order of Month in line chart as shown in the picture:
- v-lili6-msft5 years ago
Community Support
hi Dunner2020
In edit queries, add a costom column as below:
if [Month Of Year]>=4 then ([Year]*100)+[Month Of Year]-3 else ([Year]-1)*100+[Month Of Year]+9Now use this custom column to sort by column
Result:
and here is sample pbix file, please try it.
Regards,
Lin