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
Step927
Regular Visitor

Order Matrix Month-Year in ascending order

 

Dear Community,


I'm having trouble sorting a Matrix  in ascending order by  Month-year (Jan 2013- text format) that takes the last 13 months based on the date picker . Do you have any solution? Many Thanks

 

1 ACCEPTED SOLUTION
reidnmorrison
Resolver II
Resolver II

To sort the months you can add a custom column to the 'Calendar table' in Power Query that will allow you to sort the [Month_Year_Short] column:

 

Text.From([Year]) & Text.PadStart(Text.From([Month_No]), 2, "0")

 

 

If you are needing to create a measure to dynamically look back 13 months I would suggest watching this video. It can be modified to 13 months https://www.youtube.com/watch?v=d8Rm7dwM6gc

View solution in original post

3 REPLIES 3
reidnmorrison
Resolver II
Resolver II

To sort the months you can add a custom column to the 'Calendar table' in Power Query that will allow you to sort the [Month_Year_Short] column:

 

Text.From([Year]) & Text.PadStart(Text.From([Month_No]), 2, "0")

 

 

If you are needing to create a measure to dynamically look back 13 months I would suggest watching this video. It can be modified to 13 months https://www.youtube.com/watch?v=d8Rm7dwM6gc

reidnmorrison
Resolver II
Resolver II

Do you have a Calander or Dates table in your model. If so what columns do you have in it?

 

 

Hi, below a screenshot of the model.

In the matrix I use the "Month-Year-Short" field in the Calendar Table.
In the date filter I use the date key field from the Tine-Dim
Model.png

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.