cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MarkPalmberg
Kudo Collector
Kudo Collector

alternative to ISFILTERED when Select All is used

I have a measure I'm using to limit the data that appears on a map visual. It looks like this:

 

ShowMap = 
VAR UnitFilter =
    IF(
        ISFILTERED('Pool View'[UNIT])
        ,1
        ,0)

VAR TierFilter =
    IF(ISFILTERED('Pool View'[TIER])
        ,1
        ,0
    )

VAR StateFilter =
    IF(ISFILTERED('Pool View'[STATE])
        ,1
        ,0
    )

VAR FilterSum = UnitFilter + TierFilter + StateFilter

RETURN
    IF(FilterSum = 3,"Y","N")

Trouble arises when someone uses Select All in the Tier filter. There are six values there, and I'm trying to avoid having my users individually select all the values when they want to include them all. What's a good substitue for ISFILTERED when Select All is in play? Thanks.

1 ACCEPTED SOLUTION
MarkPalmberg
Kudo Collector
Kudo Collector

I modified the measure as so, which now works.

 

ShowMap = 
VAR UnitFilter =
    IF(
        ISFILTERED('Pool View'[UNIT])
        ,1
        ,0)

VAR TierFilter =
    IF(
        COUNTROWS(DISTINCT(ALLSELECTED('Pool View'[TIER]))) >= 1
        ,1
        ,0
    )

VAR StateFilter =
    IF(ISFILTERED('Pool View'[STATE])
        ,1
        ,0
    )

VAR FilterSum = UnitFilter + TierFilter + StateFilter

RETURN
    IF(FilterSum = 3,"Y","N")

View solution in original post

1 REPLY 1
MarkPalmberg
Kudo Collector
Kudo Collector

I modified the measure as so, which now works.

 

ShowMap = 
VAR UnitFilter =
    IF(
        ISFILTERED('Pool View'[UNIT])
        ,1
        ,0)

VAR TierFilter =
    IF(
        COUNTROWS(DISTINCT(ALLSELECTED('Pool View'[TIER]))) >= 1
        ,1
        ,0
    )

VAR StateFilter =
    IF(ISFILTERED('Pool View'[STATE])
        ,1
        ,0
    )

VAR FilterSum = UnitFilter + TierFilter + StateFilter

RETURN
    IF(FilterSum = 3,"Y","N")

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors
Top Kudoed Authors