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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.