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

How to sort in financial year in pivot table?

I need the sort to start from Aug-July and i have this already and it wont start from Aug:

michellerob2000_0-1709566673833.png

 

michellerob2000_1-1709566699795.png

Data tab:

michellerob2000_3-1709566742741.png

 

Really appreciate youre help

 

Michelle.

 

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

Hi @michellerob2000 ,

Have you solved your problem?
If not, you can try to achieve this by using this M function in Power Query:

Table.Sort(#"Changed Type", {each List.PositionOf({"August", "September", "October", "November", "December", "January", "February", "March", "April", "May", "June", "July"}, [Month])})

 And the final output is as below:

vjunyantmsft_0-1711000312637.png

Here is the whole M function in the Advanced Editor:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("XZCxDsIgEIbfhblLacE6NjEOJurg2HSghKhJbRssJn17BQ45GG758vHf/XQdOYnJCL2RgpS/qRnpCwypHe7gUQ0aq01OrVt79yy0fIBYsgRZy0vtop9jmhaQlRin8HDLk8I2DueaSYFSUUyss2uAjCFmzzChsXZr7ua9ptafuX0+/aaWVb0GpdO7MLZ2VTp8lescXSgaoa/q4GX+4FiaQxp3HZTEKqQiCt/cfwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Month = _t, ID = _t, Value = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Month", type text}, {"ID", Int64.Type}, {"Value", Int64.Type}}),
    #"Sort Table" = Table.Sort(#"Changed Type", {each List.PositionOf({"August", "September", "October", "November", "December", "January", "February", "March", "April", "May", "June", "July"}, [Month])})
in
    #"Sort Table"


Best Regards,
Dino Tao
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-junyant-msft
Community Support
Community Support

Hi @michellerob2000 ,

Have you solved your problem?
If not, you can try to achieve this by using this M function in Power Query:

Table.Sort(#"Changed Type", {each List.PositionOf({"August", "September", "October", "November", "December", "January", "February", "March", "April", "May", "June", "July"}, [Month])})

 And the final output is as below:

vjunyantmsft_0-1711000312637.png

Here is the whole M function in the Advanced Editor:

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("XZCxDsIgEIbfhblLacE6NjEOJurg2HSghKhJbRssJn17BQ45GG758vHf/XQdOYnJCL2RgpS/qRnpCwypHe7gUQ0aq01OrVt79yy0fIBYsgRZy0vtop9jmhaQlRin8HDLk8I2DueaSYFSUUyss2uAjCFmzzChsXZr7ua9ptafuX0+/aaWVb0GpdO7MLZ2VTp8lescXSgaoa/q4GX+4FiaQxp3HZTEKqQiCt/cfwE=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Month = _t, ID = _t, Value = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Month", type text}, {"ID", Int64.Type}, {"Value", Int64.Type}}),
    #"Sort Table" = Table.Sort(#"Changed Type", {each List.PositionOf({"August", "September", "October", "November", "December", "January", "February", "March", "April", "May", "June", "July"}, [Month])})
in
    #"Sort Table"


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

lbendlin
Super User
Super User

Create a "Fiscal Year Month"  column and sort by that.   So "20/21-01"  could be August 2020 and "20/21-12" could be July 2021.

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.

Top Solution Authors
Top Kudoed Authors