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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
gibc
Frequent Visitor

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. 

 

My formula in excel is:

 

IF([@ED]=TRUE,"high financial stress",

IF(AND([@LWM1]>2,[@FC]>2,[@LWM2]>2,[@ED]=FALSE,[@R]=FALSE),"no financial stress",

IF(AND([@LWM1]=1,(OR([@FC]<3)),(OR([@LWM2]<3)),[@R]=TRUE),"high financial stress","financial stress")))

 

And i need to convert this to DAX for a custom column.

Any help would be hugely appreciated 🙂

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

@gibc,

 

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.

View solution in original post

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

@gibc,

 

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.

Thanks so much for your help @v-yuta-msft 

I don't need to use/create new formulas very often so am struggling to improve my understanding of DAX in PowerBI. Are there any particular resources that you would reccommend for this? (other than what's on PowerBI site)

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.