Forum Discussion

msam86's avatar
msam86
Helper I
1 year ago
Solved

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], "Suppo...
  • johnbasha33's avatar
    1 year ago

    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 !!