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

Date (Year & Quarter) Sorting in a Graph

Hi All

 

I've got a supply and demand graph. Numbers wise my supply is a positive number and demand is a negative. The source is an excel spreadsheet. One of my columns is a text field which has for eg: 2021/Q1, 2021/Q2 and so on. I also added a colum that had a an actual date of the first day of each quater.  Thirdly (after you tubing) I created a calendar table for good measure.

 

No matter what I do, I cannot get a graph with years/quaters in the correct order. If I choose from the calendar version, I get year but it doesn't have the quater. If I use my column that has 20201/Q1 etc, it displays but not in order??? Any tips on what I may be doing wrong or should do a better way, I'm all ears?????

 

My graph is below to illustrate the lack of sorting!

 

Cheers

Rob

 

rob1975_0-1613454887110.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

System Undersatnd ordering based on String data type because it's look like there are no seperate columns for year and It's Quarters. 
Easy way to do it by creat indexing for Year/Qn column. and set created index column as order referance for Yr/Q column.
Check this: https://www.youtube.com/watch?v=4xapOrfLvbg

Keep Going 
Best Regards,
Nirav

View solution in original post

4 REPLIES 4
CGodfrey
Frequent Visitor

Replying to this late but I have another solution.

When I tried dropping in the year and quarter into the X-value I couldn't get the order right. I would sort by quarter, or year and it would always end up wrong. Then I tried drilling up and down in the chart to get the years to appear below the quarters, no luck. I also tried these methods with and without concatenate in the Format Visuals -> X-axis -> Values menu. Nothing. 

What ended up working is creating a hierarchy and then dropping the hierarchy into the visual instead of the individual values. Hope that helps someone else.

v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

If your X-axis column is a text type, you have to use the "Sort by column" feature to sort it, so I suggest you use the date hierarchy.

v-lionel-msft_0-1613633344083.png

 

Best regards,
Lionel Chen

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

 

Anonymous
Not applicable

Hi @Anonymous ,

System Undersatnd ordering based on String data type because it's look like there are no seperate columns for year and It's Quarters. 
Easy way to do it by creat indexing for Year/Qn column. and set created index column as order referance for Yr/Q column.
Check this: https://www.youtube.com/watch?v=4xapOrfLvbg

Keep Going 
Best Regards,
Nirav

amitchandak
Super User
Super User

@Anonymous , this format itself is sortable.  On the three dot. Choose qtr year as the sort column. If this does not work

 

Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

 

Also refer how to use sort column - https://www.youtube.com/watch?v=KK1zu4MBb-c

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.