Forum Discussion

chotu27's avatar
chotu27
Icon for Post Patron rankPost Patron
6 years ago
Solved

Muliple if Condition with multiple conditions

Hi All,   Ignatkovkir    Below is the sample data Column 1       Column2 EMEN -OTT OLX EIN -OTT OLX EMEN -OTT OIA ANIN -OTT TRS EMEN -OTT BHT EMEN -OTT STA EMEN -OTT ...
  • v-alq-msft's avatar
    6 years ago

    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:

     

    Best Regards

    Allan

     

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