Forum Discussion

Jit007's avatar
Jit007
Helper II
2 years ago
Solved

Custom Sorting in measures (legend)

I'm unable to sort the data which comes from calculate measure as per below order,,any idea which steps needs to follow to correct the order

 

Excellent1
Good2
Average3

11 Replies

  • Create a static reference table in your data model. Keep it disconnected.

     

    Feed the visual from the first column, Use the measure to find the selected value and return the associated result.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Jit007 ,

    lbendlin Thanks for your concern about this case!

    I'll detail what lbendlin means with test data.
    Here is my sample data:

    I use this DAX to create the measure:

    Here is the Table(2):

    And use this DAX to create another meaure:

    Measure 2 = MINX(FILTER('Table (2)', 'Table (2)'[level] = [Measure]), 'Table (2)'[rank])

    Sorting on measure 2:

    But there is a problem with this approach, which is that both measure and measure 2 must exist in your visual object. If you don't want measure 2 to appear in the Table visual object, you can play a little mind trick:

    Then click on the edge of the cell where the measure 2 column header is located and pull it inward until you can't see the column.

    This way, even though measure 2 is no longer visible, both measure and measure 2 still exist in the table.

    Best Regards,
    Dino Tao
    If this post helps, then please consider Accept both of the answers as the solution to help the other members find it more quickly.