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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Jaggana
Frequent Visitor

Search if a list of selected values is in a list

I had to find ou if a list of selected values is in a list of values, but I was facing an error: "A table of multiple values was supplied where a single value was expected", which is relevant.

 

I finally solve this using this:

VAR SelectedChannels = VALUES(DIM_CHANNEL[CHANNEL_NM])
VAR letters = {"aa", "bb", "cc"}
VAR numbers = {"1","2"}
            

RETURN
    SWITCH(
        TRUE(),
        COUNTROWS(FILTER(SelectedChannels, NOT([CHANNEL_NM] IN letters ))) = 0,	"Letters",
        COUNTROWS(FILTER(SelectedChannels, NOT([CHANNEL_NM] IN numbers))) = 0,	"Numbers",
        // Neither letters nor numbers and 1 selected value
        COUNTROWS(SelectedChannels) = 1, SelectedChannels,
        "Multiple other values"
    )
3 REPLIES 3
v-priyankata
Community Support
Community Support

Hi @Jaggana 

Thank you for reaching out to the Microsoft Fabric Forum Community.


Great job, This is a very useful tip for the community, thanks for taking the time to share your solution.

amitchandak
Super User
Super User

@Jaggana , Try like 

VAR SelectedChannels = VALUES(DIM_CHANNEL[CHANNEL_NM])
VAR letters = {"aa", "bb", "cc"}
VAR numbers = {"1","2"}

RETURN
SWITCH(
TRUE(),
COUNTROWS(FILTER(DIM_CHANNEL[CHANNEL_NM], NOT([CHANNEL_NM] IN letters ))) = 0, "Letters",
COUNTROWS(FILTER(DIM_CHANNEL[CHANNEL_NM], NOT([CHANNEL_NM] IN numbers))) = 0, "Numbers",
// Neither letters nor numbers and 1 selected value
COUNTROWS(SelectedChannels) = 1, CONCATANATEX(SelectedChannels,[CHANNEL_NM], " ,"),
"Multiple other values"
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you @amitchandak but it works fine, I am just giving a tip to the community 🙂

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI 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.

Top Solution Authors
Top Kudoed Authors