How to Dynamically Hide Items in a Slicer based on the Fact Table

maxresdefault

Why This Matters

If you’ve ever opened a Power BI report and found a slicer full of options that return no results, you know how frustrating it can be. Users click through multiple items only to see blank visuals, giving the impression that the report is broken or incomplete.

This happens because Power BI displays all the values in your dimension table, even if those values have zero related records in your fact table.

Fortunately, there’s a fast and reliable fix.

screenshot 2026 02 10 102950

The Solution: Dynamically Hide Empty Slicer Items

By creating a simple DAX measure and applying it as a visual-level filter, you can ensure that slicers only show items that actually have data.

The result?
Cleaner slicers, faster decision‑making, and a more professional reporting experience.

Step-by-Step: How to Hide Empty Items in Power BI Slicers

Step 1: Create the DAX Measure

Use this simple formula (modify table and column names as needed):

Dim Filter =
IF(
    DISTINCTCOUNT(FactTable[ColumnID]) > 0,
    1,
    0
)
DAX

What this does:

  • Counts how many times a dimension value appears in your fact table
  • If the value appears at least once → return 1
  • Otherwise → return 0

Step 2: Apply the Filter to the Slicer

  1. Select your slicer
  2. Open the Filters pane
  3. Drag Dim Filter into Filters on this visual
  4. Set it to show only items where: Dim Filter is greater than 0
slicge

Instantly, all empty slicer items disappear.


Step 3: Enjoy the Improvement

Your slicer now displays only the values that matter.
No more empty states. No more confused users.


Real‑World Examples

You may have 500 stores in your master table, but only 200 had sales this month.
Filtered slicers show only the 200 active stores.

You sell 50 product categories, but only 15 have inventory.
Your slicer now shows 15 relevant options, not 50.

Your company operates in 100 cities, but only 30 had Q4 transactions.
The slicer reflects only the 30 active cities.


Common Mistakes to Avoid

Make sure your dimension table is correctly related to your fact table.

Double‑check column names—especially if your model uses custom or renamed fields.

Add or remove data and confirm the slicer updates dynamically.


Advanced Version: Multiple Fact Tables

If your dimension relates to multiple datasets (e.g., Sales + Inventory), use this extended version:

Dim Filter =
VAR HasSales = DISTINCTCOUNT(Sales[Store])
VAR HasInventory = DISTINCTCOUNT(Inventory[Store])
RETURN
IF(HasSales + HasInventory > 0, 1, 0)
DAX

Watch the video here

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top