Forum Discussion
Manish1198
1 year agoHelper I
Sorting a matrix visual based on a measure
I have the following setup for a matrix visual as I want to show different measures for different categories. All the values are populated using the following measure. Thanks MFelix for the ...
danextian
1 year agoSuper User
Hi Manish1198
A matrix visual with column headers can currently only be sorted based on the column total, not on individual column header categories. To control the sort order, the total must return a custom value, in your case the value of office. Please note that this also affects the total being displayed—it will not show the total for all categories, but only the value for office supplies.
Sample measure:
Officel Supplies Sales - Total Column =
IF (
NOT ( HASONEVALUE ( 'dim table'[category column] ) ),
CALCULATE ( [sales], KEEPFILTERS ( 'dim table'[category column] = "Office Supplies" ) ),
[sales]
)