Forum Discussion

AllanBerces's avatar
AllanBerces
Post Prodigy
1 year ago
Solved

IF with Multiple Condition

Hi Good day, Can anyone pls need assistance on how can i get the result i need.  - The Period should equal to Q1  - The Location is under EAST and SOUTH only  - For SOUTH Location, the Priority s...
  • rajulshah's avatar
    1 year ago

    Hello AllanBerces ,

     

    Please try following DAX formula in calculated column and please let me know if you face any issues.

    RESULT =
    IF (
        [Period] = "Q1",
        IF (
            [Location] = "EAST"
                || (
                    [Location] = "SOUTH"
                        && SEARCH ( "1", [Priority], 1, BLANK () ) = 1
                ),
            [Project/Mntc],
            "EXCLUDED"
        ),
        "EXCLUDED"
    )
  • bhanu_gautam's avatar
    1 year ago

    AllanBerces Create a new column to determine if the row meets the conditions

     

    DAX
    Result =
    IF (
        'Table'[Period] = "Q1" &&
        (
            'Table'[Location] = "EAST" ||
            (
                'Table'[Location] = "SOUTH" &&
                LEFT('Table'[Priority], 1) = "1"
            )
        ),
        'Table'[Project/Mntc],
        "Excluded"
    )