Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
grkanth81
Helper I
Helper I

Sorting the data in the stacked column chart by Month Name

Hi All,

I am facing an issue with sorting the data in the Stacked column chart.

Please check the below screenshot. 

I would like the values inside the stacked bar chart to be sorted like July, August, September, October, November etc.... Any idea how to achieve this?

 

Thanks,

RavCapture.PNG

1 ACCEPTED SOLUTION
Hardik
Continued Contributor
Continued Contributor

Screenshot_7.png

Select the months column and in the modelling tab ,select sort by column.I hope this works for you.

 

Or you can also assign numbers to the months ,if the above doesn't work.

Month=SWITCH([MonthNumber],
1,"January",
2,"Feburary",
3,"March",
4,"April",
5,"May",
6,"June",
7,"July",
8,"August",
9,"September",
10,"October",
11,"November",
12,"December",
"Invalid Month Number"

View solution in original post

8 REPLIES 8
Hardik
Continued Contributor
Continued Contributor

hey ! kindly check the data type of your Months column ,if it is a string or date type .Maybe the data is not geting displayed in a chronological order.

Hi Hardik,

 

The MonthName column is having a data type of Text.

Basically i have one column which has date values and as i created this new column MonthName from it using DAX

=FORMAT([InvoiceDate],"MMMM")

 

Thanks

Hardik
Continued Contributor
Continued Contributor

Screenshot_7.png

Select the months column and in the modelling tab ,select sort by column.I hope this works for you.

 

Or you can also assign numbers to the months ,if the above doesn't work.

Month=SWITCH([MonthNumber],
1,"January",
2,"Feburary",
3,"March",
4,"April",
5,"May",
6,"June",
7,"July",
8,"August",
9,"September",
10,"October",
11,"November",
12,"December",
"Invalid Month Number"

Thanks Hardik.

Your first option worked now (going to data modelling and selecting the sort by column option). I was doing it wrong initially.

Its all fixed now.

 

Thanks

Hardik
Continued Contributor
Continued Contributor

@grkanth81 pleasure 

Hi Hardik,

 

I already have another column which displays only Month Numbers. when i try use with this, it works perfectly fine, but i would like to display names of the months in the chart rather than numbers.

 

Thanks...Capture1.PNG

Hardik
Continued Contributor
Continued Contributor

You can format the month number column to the month name as you did for the invoice date column.

Hardik
Continued Contributor
Continued Contributor

Screenshot_7.pngSelect the months column and in the modelling tab ,select sort by column.I hope this works for you.

 

Or you can also assign numbers to the months ,if the above doesn't work.

Month=SWITCH([MonthNumber],
1,"January",
2,"Feburary",
3,"March",
4,"April",
5,"May",
6,"June",
7,"July",
8,"August",
9,"September",
10,"October",
11,"November",
12,"December",
"Invalid Month Number"

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.