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
AlmantasPBIguy
Frequent Visitor

Changing sort order per category

Hey guys, 

 

Lets say I have a table with 4 columns: Attribute, Category and Order and Percent. The order is different per category. 

AlmantasPBIguy_0-1698997783560.png

In a column chart I have atributes in the x and percent in the y. The category is in a slicer. I want to sort the attributes by the order, depending on what category is selected in the slicer. Here is an example file:
https://drive.google.com/file/d/1E8_zlZgmD0xbDk_A9Lhl3JGXA0-qx8ei/view?usp=share_link 

 

Any ideas?

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @AlmantasPBIguy ,

 

Since the attribute is the same and the order differs you cannot make a sort by column one option can be to create a new column that uses a empty character something similar to this:

 

 

 

New Column = REPT("<u+200f><u+200f><u+200e> <u+200e>", 'Table'[Order]) &amp;olumn = REPT("<u+200f><u 'Table'[Attribute]<u+200f><u+200f><u+200e> <u+
'Table'[Attribute]<u+200f><u

 nbsp;e'[Attribute]<u+200f><u

nbsp;e'[Attribute]<u+200f><u

MFelix_0-1698999997884.png

In the table it will look separated but when you used it on the visualizations the character will dissapear:

MFelix_2-1699000075123.pngMFelix_3-1699000081939.png

 

 

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

2 REPLIES 2
MFelix
Super User
Super User

Hi @AlmantasPBIguy ,

 

Since the attribute is the same and the order differs you cannot make a sort by column one option can be to create a new column that uses a empty character something similar to this:

 

 

 

New Column = REPT("<u+200f><u+200f><u+200e> <u+200e>", 'Table'[Order]) &amp;olumn = REPT("<u+200f><u 'Table'[Attribute]<u+200f><u+200f><u+200e> <u+
'Table'[Attribute]<u+200f><u

 nbsp;e'[Attribute]<u+200f><u

nbsp;e'[Attribute]<u+200f><u

MFelix_0-1698999997884.png

In the table it will look separated but when you used it on the visualizations the character will dissapear:

MFelix_2-1699000075123.pngMFelix_3-1699000081939.png

 

 

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Worked like a charm, thanks!

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.