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

Order of rows in unpivoted table

I have an unpivoted table used to create a stacked column chart. See below.BICapture11.JPG

The chart does not display the Financial Years in the correct order. I added an Index column but this didn't work because the table has duplicate values (each financial year). Is there a way to get the financial years in the correct order?

Thanks 

Steve

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

My suggestion would be to split the Financial Year into 2 columns - delete the second column and rename the first column as Year.  Assuming January is first month of your FY, write this calculated column formula

Date=1*("1/1/"&Data[Year])

Format this as a date column.

Now create a Calendar Table and in a calculated column of the Calendar Table, extract the Year.  Build a relationship from the Date column of your Data Table to the Date column of the Calendar Table.  To your visual, drag Year from the Calendar Table.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

6 REPLIES 6
v-gizhi-msft
Community Support
Community Support

Hi,

 

You can change it sort by Financial Year through clicking options on this visual:

30.jpg

Hope this helps.

 

Best Regards,

Giotto Zhi

 

Anonymous
Not applicable

Thank you all for the suggested solutions. While some approaches did not seem to work initially, when I deleted the chart and rebuilt it they did work, so I am happy!

 

Steve 

This is a sneaky feature of 'Sort by Column'.  You either have to remove the relevant field from the visualisation and re-add it OR delete the visual and start again.

Ashish_Mathur
Super User
Super User

Hi,

My suggestion would be to split the Financial Year into 2 columns - delete the second column and rename the first column as Year.  Assuming January is first month of your FY, write this calculated column formula

Date=1*("1/1/"&Data[Year])

Format this as a date column.

Now create a Calendar Table and in a calculated column of the Calendar Table, extract the Year.  Build a relationship from the Date column of your Data Table to the Date column of the Calendar Table.  To your visual, drag Year from the Calendar Table.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

Can you create a custom sort column and mark it as sort

Sort_by_column.png

HotChilli
Super User
Super User

How about duplicating the column, split it to get the first 4 numbers (call it start year or something).  Set the data type to be number.

You can then use that with the 'Sort by Column' functionality.  i.e. Select Financial Year-> Sort By Column -> start year

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.