Forum Discussion
Remove blanks from dynamic slicer
Create a measure that checks if the selected values in the slicer are not blank. This measure will return 1 for non-blank values and 0 for blank values.
NonBlankValues =
IF(
ISBLANK(SELECTEDVALUE('YourTable'[YourColumn])),
0,
1
)
Use the Measure in the Filter Pane: Add this measure to the filter pane of your slicer visual. Set the filter condition to show only values where the measure equals 1.
Select the slicer visual.
Drag the NonBlankValues measure to the Filters pane.
Set the filter to show items when the value is 1.
To ensure that the filtering works dynamically regardless of the number of columns included, you can create a similar measure for each column you want to filter and combine them using a logical AND operation.
DAX
NonBlankValuesDynamic =
IF(
ISBLANK(SELECTEDVALUE('YourTable'[Column1])) ||
ISBLANK(SELECTEDVALUE('YourTable'[Column2])) ||
ISBLANK(SELECTEDVALUE('YourTable'[Column3])),
0,
1
)
Adjust the measure to include all relevant columns. This measure will return 1 only if all selected columns have non-blank values.
Apply the Combined Measure: Use the combined measure in the filter pane of your slicer visual
Hi bhanu_gautam
Thank you for your input.
Unfortunately this isn't working as I'm still seeing the blank/empty values.
Using countrows, filtering for non blank works, but the moment you get into the next column to slice for, I start to see the empty values again.
I don't want to filter out columns that aren't being filtered on so I can't just do a countrows over each column, as this becomes a static solution.