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
DevadathanK
Resolver I
Resolver I

Ordering Column values

Hi Community!

<Message deleted>

Thanks in advance!

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@DevadathanK , You need to create sort column and then mark that as sort column of this column .

 

https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column

 

new columns

Aging1= Aging

 

Aging Sort =

Switch( True() ,
Aging=ing ="3-5", 1,
Aging= "6-9", 2,
Aging="10-15", 3,
// Add more conditions ,
4)

 

to avoid circular dependencies, create aging1 Sort that on Aging Sort and use Aging 1

 

View solution in original post

Pragati11
Super User
Super User

Hi @DevadathanK ,

 

You will have to create a custom sort order for this column as their naming is not by-default in an order.

You can create an sortOrder column like this:

sortOrder = IF([Aging] = "0 to 2 Days", 1, IF([Aging] = "3 to 5 Days", 2, IF([Aging] = "6 to 9 Days", 3,  IF([Aging] = "10 to 15 Days", 4, 5)))) 

 

Now use this sortOrder column to sort your Aging column in the data by using SORT BY COLUMN in Data section.

Click on your Aging column under Data tab in Power BI and using Sort By Column as shown below: (Select sortOrder column under Sort By Column option)

test11.png

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

5 REPLIES 5
Pragati11
Super User
Super User

Hi @DevadathanK ,

 

You will have to create a custom sort order for this column as their naming is not by-default in an order.

You can create an sortOrder column like this:

sortOrder = IF([Aging] = "0 to 2 Days", 1, IF([Aging] = "3 to 5 Days", 2, IF([Aging] = "6 to 9 Days", 3,  IF([Aging] = "10 to 15 Days", 4, 5)))) 

 

Now use this sortOrder column to sort your Aging column in the data by using SORT BY COLUMN in Data section.

Click on your Aging column under Data tab in Power BI and using Sort By Column as shown below: (Select sortOrder column under Sort By Column option)

test11.png

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

negi007
Community Champion
Community Champion

@DevadathanK  You will need create one more table where you will have two columns 

1. Sorting column (column on which sorting is required)

2. SI No

 

Once you create this table, then create relationship with your main table. Once realtionship is created then in your new table in Data tab you will get option to sort column by SI NO.




Did I answer your question? Mark my post as a solution!
Appreciate your Kudos



Proud to be a Super User!


Follow me on linkedin

amitchandak
Super User
Super User

@DevadathanK , You need to create sort column and then mark that as sort column of this column .

 

https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column

 

new columns

Aging1= Aging

 

Aging Sort =

Switch( True() ,
Aging=ing ="3-5", 1,
Aging= "6-9", 2,
Aging="10-15", 3,
// Add more conditions ,
4)

 

to avoid circular dependencies, create aging1 Sort that on Aging Sort and use Aging 1

 

Thanks for this Solution @amitchandak . I followed the same steps but still im getting circular dependency after sorting Aging1 column on Aging Sort. How should i remove this? Please help.

Hi @amitchandak 

Thank you for the insight! I got the circular dependency, thank you for letting me know the solution to it.

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.