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

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

Reply
AH2022
Helper II
Helper II

Filter Visual on Condition (measure slicer)

 

Hi All,

 

Maybe it's obvious,

But I've tried several methods (measure slicer), filter on this visual, etc and I haven't found a solution.

 

How can I filter this visual for:

- no sales 2022, sales 2021

- no sales 2022, sales 2020

- no sales 2022, sales 2019

 

 

AH2022_0-1661305289655.png

 

Expected Result:

AH2022_1-1661305289664.png

 

 

Regards and Tanks !

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@AH2022 , you could create a measure to implement the logic to determine whether or not to show a customer in the matrix. For example:

 

ShowRowInMatrix = 
    VAR v2022 = CALCULATE('Data'[Total Sales], ALL('_Date'), '_Date'[Year] = 2022)
    VAR v2021 = CALCULATE('Data'[Total Sales], ALL('_Date'), '_Date'[Year] = 2021)
    VAR v2020 = CALCULATE('Data'[Total Sales], ALL('_Date'), '_Date'[Year] = 2020)
    VAR v2019 = CALCULATE('Data'[Total Sales], ALL('_Date'), '_Date'[Year] = 2019)
    RETURN 
        SWITCH(TRUE(),
            ISBLANK(v2022) && v2021 <> 0, "Y",
            ISBLANK(v2022) && v2020 <> 0, "Y",
            ISBLANK(v2022) && v2019 <> 0, "Y",
            "N"
        )

 

Then add the measure as to the filters pane on the matrix and set the filter for values Y.

Rows that meet the criteria will be shown. 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

@AH2022 , you could create a measure to implement the logic to determine whether or not to show a customer in the matrix. For example:

 

ShowRowInMatrix = 
    VAR v2022 = CALCULATE('Data'[Total Sales], ALL('_Date'), '_Date'[Year] = 2022)
    VAR v2021 = CALCULATE('Data'[Total Sales], ALL('_Date'), '_Date'[Year] = 2021)
    VAR v2020 = CALCULATE('Data'[Total Sales], ALL('_Date'), '_Date'[Year] = 2020)
    VAR v2019 = CALCULATE('Data'[Total Sales], ALL('_Date'), '_Date'[Year] = 2019)
    RETURN 
        SWITCH(TRUE(),
            ISBLANK(v2022) && v2021 <> 0, "Y",
            ISBLANK(v2022) && v2020 <> 0, "Y",
            ISBLANK(v2022) && v2019 <> 0, "Y",
            "N"
        )

 

Then add the measure as to the filters pane on the matrix and set the filter for values Y.

Rows that meet the criteria will be shown. 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.