Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Nested IF statements with several variables - convert from excel to DAX

I'm currently trying to convert existing excel formulas I have into PowerQuery (which i've only just started using). A lot of it is straightforward, but i've come unstuck with nested IF statements. ...
  • v-yuta-msft's avatar
    7 years ago

    Anonymous,

     

    You modify your formula using DAX below:

     

    Result =
    IF (
        [@ED] = TRUE,
        "high financial stress",
        IF (
            ( [@LWM1] > 2 )
                && ( [@FC] > 2 )
                && ( [@LWM2] > 2 )
                && ( [@ED] = FALSE )
                && ( [@R] = FALSE ),
            "no financial stress",
            IF (
                ( [@LWM1] = 1 )
                    && ( ( [@FC] < 3 )
                    || ( [@LWM2] < 3 )
                    || ( [@R] = TRUE ) ),
                "high financial stress",
                "financial stress"
            )
        )
    )
    

    Community Support Team _ Jimmy Tao

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