Forum Discussion

AlmantasPBIguy's avatar
AlmantasPBIguy
Frequent Visitor
2 years ago
Solved

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. 

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?

  • 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

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

     

     

     

2 Replies

  • 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

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