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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
CowboyTony
Regular Visitor

IF DAX Calculated Column

Hey Guys,

I dont seem to be getting the right behaviour with the folowing dax statement in a calculated column:

 

WO Completion Date =

if('Work Orders'[Closed?]="Closed",'Work Orders'[Malfunction End Date],

if('Work Orders'[Malfunction End Date]=blank(),'Work Orders'[Max Labour Date],

if('Work Orders'[Max Labour Date]=blank(),'Work Orders'[Pseudo Complete date],

blank())))

 

WO Completion DateClosed?Malfunction End dateMax Labour DatePseudo Complete date
1/1/2018Closed1/1/2018 6/7/2017 0:00
1/2/2018Closed 1/2/20186/7/2017 0:00
1/3/2018Closed  1/3/2018 0:00
 Open  6/7/2017 0:00

 

 

I want to create the above result set in calculate column "WO Completion Date" where:

if the record has the status of "closed" then populate dates from the following columns in this order of preference

Malfunction End dateMax Labour DatePseudo Complete date

 if record is "open" leave column blank.

 

Help me out here guys, under pressure with this 😞

 

Regards

Cowboy Tony

 

1 ACCEPTED SOLUTION
RahulYadav
Resolver II
Resolver II

Hi @CowboyTony,

Below Dax formula should solve you problem.

 

WO Completion Date = if('Work Orders'[Closed?]="Open",BLANK(),
    if('Work Orders'[Closed?]="Closed",
        if(ISBLANK('Work Orders'[Malfunction End Date])=FALSE(),'Work Orders'[Malfunction End Date],
            if(ISBLANK('Work Orders'[Max Labour Date])=FALSE(),'Work Orders'[Max Labour Date],
                if(ISBLANK('Work Orders'[Pseudo Complete date])=FALSE(),'Work Orders'[Pseudo Complete date])))))

Thanks,

Rahul

View solution in original post

2 REPLIES 2
RahulYadav
Resolver II
Resolver II

Hi @CowboyTony,

Below Dax formula should solve you problem.

 

WO Completion Date = if('Work Orders'[Closed?]="Open",BLANK(),
    if('Work Orders'[Closed?]="Closed",
        if(ISBLANK('Work Orders'[Malfunction End Date])=FALSE(),'Work Orders'[Malfunction End Date],
            if(ISBLANK('Work Orders'[Max Labour Date])=FALSE(),'Work Orders'[Max Labour Date],
                if(ISBLANK('Work Orders'[Pseudo Complete date])=FALSE(),'Work Orders'[Pseudo Complete date])))))

Thanks,

Rahul

Works perectly, really appreciate it 🙂

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.