Skip to main content
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
msam86
Helper I
Helper I

Dinamic dax with filters

I have a table called Consolidated, where I combined 3 tables (2024, 2025, 2026):


Consolidado =
UNION(
SELECTCOLUMNS(
'2024',
"Product", '2024'[Product],
"Supplier", '2024'[Supplier],
"Supported by", '2024'[Supported by],
),
SELECTCOLUMNS(
'2025',
"Product", '2025'[Product],
"Supplier", '2025'[Supplier],
"Supported by", '2025'[Supported by],
),
SELECTCOLUMNS(
'2026',
"Product", '2026'[Product],
"Supplier", '2026'[Supplier],
"Supported by", '2026'[Supported by],
),
)
)

I have a parameter called ParameterData with the following values:

DAX
ParameterData = GENERATESERIES(2023, 2026, 1)

In each Year worksheet (2024, 2025, 2026), the "Supported by" field varies. For example:


2024
Product | Supplier | Supported by
Mobile Phone | Samsung | Samsung
Laptop | Dell | Dell
Tablet | Samsung | Samsung


2025
Product | Supplier | Supported by
Mobile Phone | Samsung | Tech Store
Laptop | Dell | Dell
Tablet | Samsung | Samsung


2026
Product | Supplier | Supported by
Mobile Phone | Samsung | Tech Store
Laptop | Dell | Tech Store
Tablet | Samsung | Samsung


I created a matrix and inserted the three fields. I also created a slicer and set the field to "Supported by." When I try to filter with the following criteria (ParameterData = 2026, Supported by = Tech Store), it filters but still shows the tablet, but with an empty "SupportedBy" field:


Product | Supplier | Supported by
Cell phone | Samsung | Tech Store
Notebook | Dell | Tech Store
Tablet | Samsung |


I would like it to show only what was selected in the slicer:

Product | Supplier | Supported by
Cell phone | Samsung | Tech Store
Notebook | Dell | Tech Store


How can I do this?

1 ACCEPTED SOLUTION
johnbasha33
Super User
Super User

Certainly! Here's a clean and friendly version of your reply, tailored for posting in a Microsoft Fabric or Power BI Community Forum:


Hi there! You're running into a common behavior in Power BI when using slicers and matrix visuals on combined tables like yours.

๐Ÿงฉ Why You're Seeing "Tablet" with a Blank "Supported by"

Even though you're filtering Supported by = Tech Store and Year = 2026, the matrix still shows "Tablet" because Power BI keeps all rows from the data unless explicitly filtered out โ€” even if one of the values (like โ€œSupported byโ€) becomes blank after slicer selection.


โœ… How to Fix It

You can solve this by adding a filter that hides rows where "Supported by" becomes blank after slicer filtering.


๐Ÿ”น Option 1: Use a Visual-Level Filter with a Measure

Create a measure like this:

Show Rows =
IF(
    ISFILTERED('ParameterData'[Value]),
    IF(
        NOT ISBLANK(SELECTEDVALUE('Consolidado'[Supported by])),
        1,
        0
    ),
    1
)

Then apply this Show Rows measure as a visual-level filter to your matrix, and set it to show only when the value = 1.

This will hide rows like "Tablet" where the filtered value doesnโ€™t match and results in blank.


๐Ÿ”น Option 2: Build a Filtered Table

If you prefer, you can create a filtered version of your union table:

FilteredConsolidado =
FILTER (
    ADDCOLUMNS (
        UNION (
            SELECTCOLUMNS('2024', "Year", 2024, "Product", '2024'[Product], "Supplier", '2024'[Supplier], "Supported by", '2024'[Supported by]),
            SELECTCOLUMNS('2025', "Year", 2025, "Product", '2025'[Product], "Supplier", '2025'[Supplier], "Supported by", '2025'[Supported by]),
            SELECTCOLUMNS('2026', "Year", 2026, "Product", '2026'[Product], "Supplier", '2026'[Supplier], "Supported by", '2026'[Supported by])
        ),
        "YearFilter", SELECTEDVALUE(ParameterData[Value])
    ),
    [Year] = [YearFilter]
        && NOT(ISBLANK([Supported by]))
)

Then use FilteredConsolidado in your matrix visual instead of the original Consolidado.


๐Ÿ”ง Bonus Tip

If you havenโ€™t already, add a Year column when building the union to make filtering easier and avoid relying solely on the slicer context.


Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!

View solution in original post

2 REPLIES 2
johnbasha33
Super User
Super User

Certainly! Here's a clean and friendly version of your reply, tailored for posting in a Microsoft Fabric or Power BI Community Forum:


Hi there! You're running into a common behavior in Power BI when using slicers and matrix visuals on combined tables like yours.

๐Ÿงฉ Why You're Seeing "Tablet" with a Blank "Supported by"

Even though you're filtering Supported by = Tech Store and Year = 2026, the matrix still shows "Tablet" because Power BI keeps all rows from the data unless explicitly filtered out โ€” even if one of the values (like โ€œSupported byโ€) becomes blank after slicer selection.


โœ… How to Fix It

You can solve this by adding a filter that hides rows where "Supported by" becomes blank after slicer filtering.


๐Ÿ”น Option 1: Use a Visual-Level Filter with a Measure

Create a measure like this:

Show Rows =
IF(
    ISFILTERED('ParameterData'[Value]),
    IF(
        NOT ISBLANK(SELECTEDVALUE('Consolidado'[Supported by])),
        1,
        0
    ),
    1
)

Then apply this Show Rows measure as a visual-level filter to your matrix, and set it to show only when the value = 1.

This will hide rows like "Tablet" where the filtered value doesnโ€™t match and results in blank.


๐Ÿ”น Option 2: Build a Filtered Table

If you prefer, you can create a filtered version of your union table:

FilteredConsolidado =
FILTER (
    ADDCOLUMNS (
        UNION (
            SELECTCOLUMNS('2024', "Year", 2024, "Product", '2024'[Product], "Supplier", '2024'[Supplier], "Supported by", '2024'[Supported by]),
            SELECTCOLUMNS('2025', "Year", 2025, "Product", '2025'[Product], "Supplier", '2025'[Supplier], "Supported by", '2025'[Supported by]),
            SELECTCOLUMNS('2026', "Year", 2026, "Product", '2026'[Product], "Supplier", '2026'[Supplier], "Supported by", '2026'[Supported by])
        ),
        "YearFilter", SELECTEDVALUE(ParameterData[Value])
    ),
    [Year] = [YearFilter]
        && NOT(ISBLANK([Supported by]))
)

Then use FilteredConsolidado in your matrix visual instead of the original Consolidado.


๐Ÿ”ง Bonus Tip

If you havenโ€™t already, add a Year column when building the union to make filtering easier and avoid relying solely on the slicer context.


Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!

msam86
Helper I
Helper I

Hello  johnbasha33

Sorry for the delay. I saw your reply, you gave me ideas and helped me find the final solution for my original code. Thank you so much for your help.

Helpful resources

Announcements
November Fabric Update Carousel

Fabric Monthly Update - November 2025

Check out the November 2025 Fabric update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Users online (27)