Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Sorting values in certain order -Matrix Visual

Hi,

I have a Matrix visual, want to sort the values that appear in certain way as in which value to be displayed first, second and third and not based on Totals(numeric column) or alphabetical sort(For text based column) . Is there any way where i can define the values based on a particular requirement ?

Eg. I have the below chart, I want to sort both ROWHEADING1 and ROWHEADING2 but not as alphabetical order. I want to have BBB value to appear first again inside BBB I want to have DEF value to be appeared first,followed by ABC, then GHI. How to achieve this?

Kindly appreciate your help

Thank you

 

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

    I created a sample pbix file(see attachment), please check whether that is what you want.

    1. Create sort order dimension tables as below screenshot using Enter Data method

    2. Create the relationships between dimension tables and fact table

    3. Apply the fields in the dimension tables onto the matrix and sort ROWHEADING1 and ROWHEADING2 by column: Sort order

    In addition, you can refer the following links to get it.

    Sort one column by another column in Power BI

    Sort a Column with a Custom Order in Power BI

    Power BI - Custom Sorting in 3 Easy Steps!

    If the above one can't help you get the desired result, please provide some sample data in your table (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

    How to upload PBI in Community

    Best Regards

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for the reply. It works

  • Anonymous , You need to create sort columns for both of them and marks as sort column

     

    example 1

    Row heading 1-1 [Row Heading 1]

     

    Row heading 1 sort = Switch([Row heading 1],

    "BBB",1,

    "CCC",2,

    3)

     

    You can mark Row heading 1 sort as a sort column for Row heading 1  or Row heading 1 _1 and use is visual Additional column suggested to avoid circular dependency

     

    How to Create Sort Column and Solve Related Errors:
    https://www.youtube.com/watch?v=KK1zu4MBb-c

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Yes, It helped. Thanks a lot