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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Month sort for multiple years data

Hello,

 

I have a requirement where I need to create a visualization by month in calendarized order   ( Jan, Feb, Mar etc) and grouped by year ( 2016, 2017). 

This seems simple to me in the begining but I could not make it work. I have attached the data, requirement and my Power BI visualization screen-prints. Any help will be appreciated.

 

Thanks,

Lakshay

 

Data.JPGPower BI- Outout.JPGRequirement.JPG

1 ACCEPTED SOLUTION
GeraSanz11
Frequent Visitor

Hi! i don't get very well what you want or whats the problem, im guessing it's the month sorting in the first chart?

 

if that the case i recomend you adding a colun with a secuential from 1 to 12, something like the last 2 digits from the [Month YYYYMM] column

 

You will end up with something like this:

Captura.JPG

 

after that in the canvas just select the column month and then in the modeling tab select SortBy and chose the id_month just created as reference 

 

Imagen1.png

 

with this the months will be sorted by the ids or the number of the month instead of A-Z sort of the names

 

Hopes this helps

View solution in original post

7 REPLIES 7
Anonymous
Not applicable


wrote:

Hello,

 

I have a requirement where I need to create a visualization by month in calendarized order   ( Jan, Feb, Mar etc) and grouped by year ( 2016, 2017). 

This seems simple to me in the begining but I could not make it work. I have attached the data, requirement and my Power BI visualization screen-prints. Any help will be appreciated.

 

Thanks,

Lakshay

 

Data.JPGPower BI- Outout.JPGRequirement.JPG



wrote:

Hello,

 

I have a requirement where I need to create a visualization by month in calendarized order   ( Jan, Feb, Mar etc) and grouped by year ( 2016, 2017). 

This seems simple to me in the begining but I could not make it work. I have attached the data, requirement and my Power BI visualization screen-prints. Any help will be appreciated.

 

Thanks,

Lakshay

 

Data.JPGPower BI- Outout.JPGRequirement.JPG




Hello,

 

Thanks for the quick reply. What you have shown is exactly what I am trying to achieve. Unfortunately, when I try to sort based on ID Month, it does not do anything.  I don't know where the problem is. Can you please help?

Sorting.JPG

just check the months ids are numeric format and not text since it will sort differently also if that doesnt solves the problem, please add a screenshot of the database in edit mode so i can figure it out

Anonymous
Not applicable

The ID month column is numeric.  See below:

 

Data type.JPG

Then i recommend to re insert the graph sometimes it wont refresh 

 

first the grap, then the values followed by the Months names, and in the end the sort by

Anonymous
Not applicable

It worked like a magic 🙂

 

In the begining, I was adding all the measures in a table visualization was then adding the bar graph. It was not doing the sorting.

 

Now, I started with the bar graph and added the data. It came perfect,

 

May be this is a bug in Power BI desktop.

 

But I am really thankful for your time and effort. It worked for me in the end!

 

Thanks,

Lakshay

@Anonymous,

 

Glad to hear that. You may help accept the solution above. Your contribution is highly appreciated.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
GeraSanz11
Frequent Visitor

Hi! i don't get very well what you want or whats the problem, im guessing it's the month sorting in the first chart?

 

if that the case i recomend you adding a colun with a secuential from 1 to 12, something like the last 2 digits from the [Month YYYYMM] column

 

You will end up with something like this:

Captura.JPG

 

after that in the canvas just select the column month and then in the modeling tab select SortBy and chose the id_month just created as reference 

 

Imagen1.png

 

with this the months will be sorted by the ids or the number of the month instead of A-Z sort of the names

 

Hopes this helps

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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