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

Order Rolling 12 month in table

AndrewDavies437_0-1654856565546.png

So I have a page that is for figures on a rolling 12 month basis and I need to order a bar chart in this way. Meaning:

 

Currently the bar chart is ordered from Jan-Dec where the data flips after May from 2022 to 2021, i need it ordered from June last year to May this year. 

 

AndrewDavies437_1-1654856992510.png

 

 

The only way I can think to do this is to have a "R12 Month Order" column on my date table that ranks each month (1-12) so that it would look like:

 

May 1

June 2 

July 3

August 4

September 5

October 6

November 7 

December 8

January 9

February 10

March 11

April 12

 

Obviously this would beed to update as the months change. Any help? Thanks.

 

1 ACCEPTED SOLUTION

If you're creating your date table in DAX then add a new line into the ADDCOLUMNS bit

"Year/Mon Sort Column", FORMAT([Date], "YYYYmm")

If you don't already have a year month column you can add one like

"Year Month", FORMAT ( [Date], "mmm YYYY" ),

set the [Year Month] column to be sorted by [Year / Mon Sort Column] and then use [Year Month] on your visuals.

 

View solution in original post

3 REPLIES 3
johnt75
Super User
Super User

Add a Year / Month Sort Order column using 

FORMAT([Date], "YYYYmm")

How would this look in DAX code please? Not 100% sure what you mean.

 

Thank you for taking the time to answer!

If you're creating your date table in DAX then add a new line into the ADDCOLUMNS bit

"Year/Mon Sort Column", FORMAT([Date], "YYYYmm")

If you don't already have a year month column you can add one like

"Year Month", FORMAT ( [Date], "mmm YYYY" ),

set the [Year Month] column to be sorted by [Year / Mon Sort Column] and then use [Year Month] on your visuals.

 

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.