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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
INJAINP
Frequent Visitor

help regarding excluding values in if else

Hello folks,

 

My requirement is as below:

 

i have a field with codes 1 to 10. I want to create a column where if all codes are there then column should give answer as WITH and if values (7 or 8 or 9) are not there (means if codes has value 1,2,3,4,5,6,10) then column should give value as WITHOUT.

 

How to accomplish this ? is there any option to exclude values in If else?

 

Regards

Priyanka

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @INJAINP,

 

You can refer to following formula to compare text value with list of records:

Result =
VAR list =
    GENERATESERIES ( 1, 10, 1 )
RETURN
    IF (
        COUNTROWS ( FILTER ( list, FIND ( [Value], [Code], 1, -1 ) > 0 ) )
            = COUNTROWS ( List ),
        "With",
        "Without"
    )

7.PNG

 

Regards,

Xiaoxin Sheng

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @INJAINP,

 

You can refer to following formula to compare text value with list of records:

Result =
VAR list =
    GENERATESERIES ( 1, 10, 1 )
RETURN
    IF (
        COUNTROWS ( FILTER ( list, FIND ( [Value], [Code], 1, -1 ) > 0 ) )
            = COUNTROWS ( List ),
        "With",
        "Without"
    )

7.PNG

 

Regards,

Xiaoxin Sheng

Helpful resources

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

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.

Top Solution Authors