Forum Discussion

johnmerm2's avatar
johnmerm2
New Member
2 years ago

matrix column ordering with slicer

I have the following table (group,entity_name,entity_order,value)

I need to present as a matrix with entity_name as the column and value as the value - the matrix is always sliced by the group attribute

 

I need to sort the columns using the sort_order attribute.
Now my problem is that since for each group, the same entity_name may have a differnet entity_order, I cannot simply sort the entity_name column by the entity_order column as it will complain that there are mulitple values matching.

 

Any suggestions?

 

 

 

5 Replies

  • Hi johnmerm2 

    Would it be possible to duplicate the table in the Query Editor, delete the extra columns, remove duplicates.

    Then in the front end join using the entity_name, on the unique table sort entity_name by entity_order.

    • johnmerm2's avatar
      johnmerm2
      New Member

      I'd need to do this when I change the group selection in the slicer

  • what if you change your entity_order (or make a entity_order2) in such a way that it contains the group?

    • johnmerm2's avatar
      johnmerm2
      New Member

      Still doesn't work . The problem is that in this table

      groupentity_nameentity_orderentity_order_2
      Aa0A_0
      Ab1A_1
      Ba1B_1
      Bb0B_0


      There will be duplicates for a (A_0,B_1) and b (B_0,A_1)

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi mostho ,
    Based on your description and the data provided, first of all if you want to avoid duplicate sorting, you need a column that is the only one that can be sorted in order, and you can use the Context function to merge these so that they can be sorted again. The value column is missing in the number you provided, please provide complete data and your expected results, so that we can help you faster.

    How to provide sample data in the Power BI Forum - Microsoft Fabric Community

    Best regards,
    Albert He

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly