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
chotu27
Post Patron
Post Patron

Muliple if Condition with multiple conditions

Hi All,

 

@Ignatkovkir 

 

Below is the sample data

Column 1       Column2

EMEN -OTTOLX
EIN -OTTOLX
EMEN -OTTOIA
ANIN -OTTTRS
EMEN -OTTBHT
EMEN -OTTSTA
EMEN -OTTSTI
ABIN-OTTOLX
BCID-OTTOIA
CFTU-OTTOIA

 

Now i want a Dax column or conditional column such that 

if(table(colum2) = OLX || TRS   and   if(table(colum2) = OIA||BHT and  if(table(colum1) = Start with "EMEN" then it should show "State coverd" and  if(table(colum2)= STA||STI then "Current State" and rest all  "not covered"

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @chotu27 

 

Based on your description, you may try the following formulas.

 

formula1 = 
IF(
    OR('Table'[Column2]="OLX",'Table'[Column2]="TRS")&&
    LEFT('Table'[Column1],4)="EMEN",
    "State Covered",
    IF(
        OR('Table'[Column2]="OIA",'Table'[Column2]="BHT")&&
        LEFT('Table'[Column1],4)="EMEN",
        "State Covered",
        IF(
            OR('Table'[Column2]="STA",'Table'[Column2]="STI"),
            "Current State",
            "not covered"
        )
    )
)
formula2 = 
SWITCH(
    TRUE(),
    OR('Table'[Column2]="OLX",'Table'[Column2]="TRS")&&LEFT('Table'[Column1],4)="EMEN","State Covered",
    OR('Table'[Column2]="OIA",'Table'[Column2]="BHT")&&LEFT('Table'[Column1],4)="EMEN","State Covered",
    OR('Table'[Column2]="STA",'Table'[Column2]="STI"),"Current State",
    "not covered"
)

 

 

Result:

a1.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-alq-msft
Community Support
Community Support

Hi, @chotu27 

 

Based on your description, you may try the following formulas.

 

formula1 = 
IF(
    OR('Table'[Column2]="OLX",'Table'[Column2]="TRS")&&
    LEFT('Table'[Column1],4)="EMEN",
    "State Covered",
    IF(
        OR('Table'[Column2]="OIA",'Table'[Column2]="BHT")&&
        LEFT('Table'[Column1],4)="EMEN",
        "State Covered",
        IF(
            OR('Table'[Column2]="STA",'Table'[Column2]="STI"),
            "Current State",
            "not covered"
        )
    )
)
formula2 = 
SWITCH(
    TRUE(),
    OR('Table'[Column2]="OLX",'Table'[Column2]="TRS")&&LEFT('Table'[Column1],4)="EMEN","State Covered",
    OR('Table'[Column2]="OIA",'Table'[Column2]="BHT")&&LEFT('Table'[Column1],4)="EMEN","State Covered",
    OR('Table'[Column2]="STA",'Table'[Column2]="STI"),"Current State",
    "not covered"
)

 

 

Result:

a1.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

I doubt on few and condition, but you can get like

 

if(table(colum2) in {"OLX", "TRS"} && table(colum2) =  in {"OIA", "BHT"} &&  search("EMEN",table(colum1),1) >0 , "State coverd" 
, if(table(colum2) in {"STA","STI"} , "Current State" ,  "not covered"))


if(table(colum2) in {"OLX", "TRS","OIA", "BHT"} &&  search("EMEN",table(colum1),1) >0 , "State coverd" 
, if(table(colum2) in {"STA","STI"} , "Current State" ,  "not covered"))

 

Or use use Switch True

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

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
Anonymous
Not applicable

You might need to make some adjustments, but a column with a switch statement should do the job.

 

ColumnName = switch(
true();
if(or(table[column2]="OLX";table[column2]="TRS");"State Covered";blank());
if(or(table[column2]="OIA";table[column2]="BHT");"State Covered";blank());
if(left(table[column1];4)="OMEN";"State Covered";blank());
if(or(table[column2]="STA";table[column2]="STI";"Current State";blank());
"Not covered")

when colum1 of "OIA" and "BHT " along with column2 of starts with "EMEN" then also it should be "State Covered"

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