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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

Replace Null with in Date field with another Date

Hi,

 

I have a column with job completion dates in it and I'm trying to fill in the blanks by using data from another data source.

 

The link between the two data sets is the job number. 

 

This is what I have so far. But I'm struggling to add some extra criteria (where clause) to narrow down what dates should be pulled back.

 

New Comp Dates = IF('Target Data'[repair_status] = 'Closed' && 'Target Data'[date_comp] = BLANK() , 'Stage History'[date_Comp] WHERE 'Stage History'[Stage_Status] = 'TBSD', 'Target Data'[date_comp])

 

How would I go about making sure that is pulling the right date over (right date per job number) as well as the date associated with the comp status change?

 

Thanks in advance

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

Hi @Anonymous ,

 

we can create a calculated column using following DAX:

 

New Comp Dates =
IF (
    'Target Data'[repair_status] = "Closed"
        && 'Target Data'[date_comp] = BLANK (),
    CALCULATE (
        MAX ( 'Stage History'[date_Comp] ),
        FILTER (
            'Stage History',
            'Stage History'[job number] = EARLIER ( 'Target Data'[job number] )
                && 'Stage History'[Stage_Status] = "TBSD"
        )
    ),
    [date_comp]
)

 

11.jpg12.jpg

 


If it doesn't meet your requirement, Please show the exact expected result based on the Tables that we have shared.


Best regards,

 

Community Support Team _ Dong Li
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

4 REPLIES 4
v-lid-msft
Community Support
Community Support

Hi @Anonymous ,

 

How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-lid-msft
Community Support
Community Support

Hi @Anonymous ,

 

we can create a calculated column using following DAX:

 

New Comp Dates =
IF (
    'Target Data'[repair_status] = "Closed"
        && 'Target Data'[date_comp] = BLANK (),
    CALCULATE (
        MAX ( 'Stage History'[date_Comp] ),
        FILTER (
            'Stage History',
            'Stage History'[job number] = EARLIER ( 'Target Data'[job number] )
                && 'Stage History'[Stage_Status] = "TBSD"
        )
    ),
    [date_comp]
)

 

11.jpg12.jpg

 


If it doesn't meet your requirement, Please show the exact expected result based on the Tables that we have shared.


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

one way is to Get The date from the second table to the first table. As a column

New date =maxx(filter(table2,table2[job]=table[job]),required_date)

 

Then using isblank and if you can replace the value.

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...
https://community.powerbi.com/t5/Community-Blog/Power-BI-Working-with-Non-Standard-Time-Periods/ba-p...
https://community.powerbi.com/t5/Community-Blog/Comparing-Data-Across-Date-Ranges/ba-p/823601

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
parry2k
Super User
Super User

@Anonymous how your tables relationship looks like? Many to One?? Which side is Many and which side is One



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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