Dyota's blog

Dax: Filter Only One

This measure, when inserted as a visual filter on a slicer or a table (or something similar), will only show items when one thing in the target table is selected.

The whole thing is wrapped in an INT() conversion, because it needs to be outputted as a number so that the filter interface can interact with it.

Filter Only One = INT(
    COUNTROWS(
        ALLSELECTED(table)
    ) = 1
)