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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
PowerBI_AL2022
Regular Visitor

How to sort in QQ-YYYY format in chart?

Hi All , 

 

i have unorganized data in the below format , but the customer wants it to be displayed in the format 

 

1. X axis as quarter and by Month : ordered by the reversed timeline (Q2 2024 then Q1 2024 then Q4 2023 then Q3 2023 etc)

2. drill down layer as Month.

 

how do i use the dax to formulate this QQ-YYYY format , 

please help 

 

thanks in advance

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

@vanessafvg Thanks for your contribution on this thread.

Hi @PowerBI_AL2022 ,

You can follow the steps below to get it:

1. Create a calculated column as below to get the format Qx YYYY

"Q"& QUARTER('Table'[Date])& " "&FORMAT('Table'[Date],"YYYY")

2. Refer the following blog to sort the column by custom

Sort a Column with a Custom Order in Power BI - RADACAD

1. Create a customized sort order dimension table

Quarter Year Order
Q2 2024 1
Q1 2024 2
Q4 2023 3
Q3 2023 4
... ...

2. Combining the Sort Order Table with 'Dimension' table

vyiruanmsft_2-1713346052226.png

3. Sort by column

vyiruanmsft_3-1713346169298.png

Best Regards

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

View solution in original post

2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

@vanessafvg Thanks for your contribution on this thread.

Hi @PowerBI_AL2022 ,

You can follow the steps below to get it:

1. Create a calculated column as below to get the format Qx YYYY

"Q"& QUARTER('Table'[Date])& " "&FORMAT('Table'[Date],"YYYY")

2. Refer the following blog to sort the column by custom

Sort a Column with a Custom Order in Power BI - RADACAD

1. Create a customized sort order dimension table

Quarter Year Order
Q2 2024 1
Q1 2024 2
Q4 2023 3
Q3 2023 4
... ...

2. Combining the Sort Order Table with 'Dimension' table

vyiruanmsft_2-1713346052226.png

3. Sort by column

vyiruanmsft_3-1713346169298.png

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
vanessafvg
Super User
Super User

are you getting that from a date table?

 

if so just create a key in the data table comprising of  the quarterno and year ie 12022 as a number  then use this value to to sort the column 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.