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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
rmeng
Helper II
Helper II

Show card with text (return TRUE) based on slicer multiselection value.

I want to display a card with text based on a true condition. In this case my measure returns FALSE:

2022 Q3 Selected Text =
IF(SELECTEDVALUE('CALENDAR'[Year Quarter]) in {"2022 Q3","2022 Q2","2022 Q4"},TRUE(),FALSE()).
Instead of False as displayed below I want a TRUE in case Year Quarter Multiselection contains 2022 Q3.

Could you give me some help?
 

rmeng_0-1668420244463.png

Thanks

1 ACCEPTED SOLUTION

Thanks,

I´ve found the solution:

                IF(
                    CONTAINS(
                        'CALENDAR',
                        'CALENDAR'[Year Quarter],"2022 Q3"
                    ),
                        TRUE(),
                        FALSE()
                )

View solution in original post

4 REPLIES 4
johnt75
Super User
Super User

You can't use SELECTEDVALUES if multiple values will be selected. Try

2022 Q3 Selected Text =
NOT ISEMPTY (
    INTERSECT (
        VALUES ( 'CALENDAR'[Year Quarter] ),
        { "2022 Q3", "2022 Q2", "2022 Q4" }
    )
)

Thanks johnt75,

But If I don´t select "2022 Q3" the condition should be FALSE. Should be TRUE when <> then "2022 Q3" Else False.

rmeng_0-1668430453541.png

 

Try

2022 Q3 Selected Text = "2022 Q3" IN VALUES( 'CALENDAR'[Year Quarter])

Thanks,

I´ve found the solution:

                IF(
                    CONTAINS(
                        'CALENDAR',
                        'CALENDAR'[Year Quarter],"2022 Q3"
                    ),
                        TRUE(),
                        FALSE()
                )

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors