How it works...

This recipe takes advantage of Power BI's behavior of filtering out rows in a Table or Matrix visualization where numeric values are included in the visualization but numeric values are blank (BLANK).

We start by simply getting the value of the Category column within the current context and storing this value in the __Category variable. Next, we get all of the values in the Category column that are currently selected in the slicer using the VALUES function and store these values in the __Categories table variable.

Next, we create the __Table table variable. We begin by using ALL to return all of the rows in our data table, R02_Table. Then, we use FILTER to only include rows where the Category column is included in our __Categories table variable (IN). Finally, we use SELECTCOLUMNS to return a single column table of the filtered values in the Category column.

Now, we can determine if our __Category is included in the __Table variable. If so, we return BLANK as this is an undesired row. Otherwise, we return 1.

If you are using a Table or Matrix visualization that includes numeric values that are not blank and force undesired rows to display, or if you're using visualizations other than the Table or Matrix visualizations, you can still use the Inverse Slicer measure to filter out undesired rows. Simply use the Filter pane and set the filter for the Inverse Slicer measure so that it only includes rows where the Inverse Slicer measure equals 1.