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
Anonymous
Not applicable

Re-ordering x-axis according to months

Hi,

 

I am trying to re-order the x-axis of my bar graph with respect to months in the year. The best I could get out of the sort feature was I was able to arrange them alphabetically but that does not help.

 

Second thing, I would like to know if there's a way I can create a standard x-axis (Jan - Dec) because there has been no activity in a few months in my data so there are no values pertaining to it. For example, May, June, and September are missing on the axis. Is there a way that I can have them on the axis but their values are 0?

1.PNG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous - 

To order by sequential months, you need to have a separate numeric month column, and set the Sort By Column to that number. (This Properties Pane is in the Model View)

Sort By Month Number.PNG

For the second part (which you'll actually need to implement first), you need a Date Table. One option, if you have a date column in your table, is to use that for your x axis. Otherwise, you'll need a separate date table. If you use a separate date table, you'll need to do the following:

1. Find a script to create a date table in M (Power Query Language) or DAX.

2. "Mark as Date Table"

3. Create a relationship with your current table

4. Set up the Sort By described above

 

Cheers!

Nathan 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

@Anonymous - 

To order by sequential months, you need to have a separate numeric month column, and set the Sort By Column to that number. (This Properties Pane is in the Model View)

Sort By Month Number.PNG

For the second part (which you'll actually need to implement first), you need a Date Table. One option, if you have a date column in your table, is to use that for your x axis. Otherwise, you'll need a separate date table. If you use a separate date table, you'll need to do the following:

1. Find a script to create a date table in M (Power Query Language) or DAX.

2. "Mark as Date Table"

3. Create a relationship with your current table

4. Set up the Sort By described above

 

Cheers!

Nathan 

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.