Forum Discussion

masplin's avatar
masplin
Icon for Impactful Individual rankImpactful Individual
2 years ago
Solved

Sorting by measure across visuals for a table or matrix

I have a matrix with multiple measures (12) but want to sort this and other matrices by the same measure. I thought I could find a neat way to sort by measure with out going via the 3 dots for each v...
  • OwenAuger's avatar
    2 years ago

    Hi masplin 

    I would recommend setting MeasureForSort equal to the underlying measure rather than computing a rank.

    e.g.

    MeasureForSort = 
    SWITCH (
        SELECTEDVALUE ( 'Ranking Measures'[Measure] ),
        "Quoted", [Cases Quoted],
        "Quoted (£)", [Cases Quoted (£)]
        -- Add additional sort options here
    )

    Then it will work regardless of the fields on the rows of the matrix, as long as you sort by MeasureToSort by clicking column header (or ellipsis menu) on each visual.

     

    I'm also guessing you were planning to "hide" this column by narrowing it to zero width on all the relevant visuals.

     

    You might also need to adjust MeasureToSort so that it returns BLANK when all the measures actually displayed are blank (not sure if needed).

     

    Example attached - will something like that work for you?

     

    Regards