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
qhpowerbi
Helper III
Helper III

Sort custom Month Year column

Hi all, 

 

I have one month-year column e.g January 2021 that drive from seperate month and year column. That 2 column drive from one datetime column from another table. 

I'm intended to use the month-year column for line chart as x-axis. How can I sort those month-year column properly on the visual.

 

Thank you in advance for the help

1 ACCEPTED SOLUTION

What I do is convert month and year to number e.g January 2021 to 202101 and sort the month-year column using the number column.

 

"sort by column" definitely help!!

 

thanks @mahoneypat 

View solution in original post

2 REPLIES 2
mahoneypat
Employee
Employee

You can either create a column with Date.ToText([Date], "yyyyMM") and use it as a Sort By column for the one in your visual. Or use a Date table that does not require a Sort By Column.

No Sort Date Tables! – Hoosier BI

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


What I do is convert month and year to number e.g January 2021 to 202101 and sort the month-year column using the number column.

 

"sort by column" definitely help!!

 

thanks @mahoneypat 

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.