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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Anonymous
Not applicable

Sort Metrics Report Column

H Guys,

Anyone t  to sort Metrics report column. see screen below.

 

Iklizo_0-1652219507644.png

 

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

Hi @Anonymous ,

 

Please try to add a custom column in Power Query and then change the type of the column to Whole Number.

 

Order_PQ =
Text.End([Date], 4) & Text.PadStart( Text.Select( Text.Start([Date],3), {"0".."9"} ), 2, "0")

vkkfmsft_3-1652406507717.png

 

Or add the calculated column.

 

Order_calculatedColumn = 
RIGHT ( [Date], 4 ) & FORMAT ( VALUE ( MID ( [Date], 2, 2 ) ), "00" )

vkkfmsft_4-1652406563320.png

 

 

Then sort [Date] column by [Order_PQ] (or [Order_calculatedColumn]) field.

 

vkkfmsft_5-1652406606563.png

 

vkkfmsft_6-1652406625067.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
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

9 REPLIES 9
v-kkf-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please try to add a custom column in Power Query and then change the type of the column to Whole Number.

 

Order_PQ =
Text.End([Date], 4) & Text.PadStart( Text.Select( Text.Start([Date],3), {"0".."9"} ), 2, "0")

vkkfmsft_3-1652406507717.png

 

Or add the calculated column.

 

Order_calculatedColumn = 
RIGHT ( [Date], 4 ) & FORMAT ( VALUE ( MID ( [Date], 2, 2 ) ), "00" )

vkkfmsft_4-1652406563320.png

 

 

Then sort [Date] column by [Order_PQ] (or [Order_calculatedColumn]) field.

 

vkkfmsft_5-1652406606563.png

 

vkkfmsft_6-1652406625067.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

how can i sort like
dec-21 jan-22 feb-22 mar-22 apr-22 may-22 jun-22 jul-22 aug-22 sep-22 oct-22 nov-22 dec-22

 

wdx223_Daniel
Super User
Super User

set a index for the dim column by the menue of Sort By Column

Anonymous
Not applicable

@wdx223_Daniel 
Please give example

Anonymous
Not applicable

@PhilipTreacy  
If you look at the screen shot, the period Name of is not sorted correctly that all. I tried sorted by column that won't work.

@Anonymous 

 

Sorry still not clear.  What's the Period Name : P1 2022 etc?  How is this not sorted correctly?  

 

Are you expecting it to be : P1 2022, P2 2022, P3 2022?  If so then you should state that so we don't have to guess what it is you want as a result.  You haven't provided any source data so we have to infer a lot from your image.

 

If this is the issue you mean, you are seeing this because your period names are text, hence what you see is properly sorted text.

 

If you want to see P1 2022, P2 2022 etc then you need to make your periods numeric or create a numeric Sort By column and sort the text period names by that.

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Anonymous
Not applicable

@PhilipTreacy 

Yes, i want P1 2022, P2 2022. I have tried sort by column still not working

@Anonymous 

 

Can you please supply your file so we don't have to recreate everything, and we can see what you have tried.

 

regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


PhilipTreacy
Super User
Super User

@Anonymous 

 

Your request is unclear.  Please state clearly the issue and show an example of the result you want.

 

Please supply data, preferably as a file, or at least as a table,  Images on their own are no good to us if we have to retype everything into PQ.

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors
Top Kudoed Authors