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 August 31st. Request your voucher.

Reply
MattSh0tt0n
Frequent Visitor

Dax Column - Copy Date from a defined column and IF blank... copy date from another defined column

Hi all, 

 

My first time posting and I'm new to PBI, so apologies if this is a little unorganized.

 

Below is a snapshot of my data table. 

 

The outcome I am looking for is to show in the "Date of Activity Logged - Copy" Column the "Date of Status Change" date for this row and IF this is blank... to show the "Date of Activity Logged" date for the same row within the "Date of Activity Logged - Copy" also.

 

MattSh0tt0n_0-1670948820165.png

 

Unfortunately the source of this dataset splits these two dates into different cells, when the preferred outcome is that only the most recent date of the two is shown in a column... if that is a different way to view the issue? 

 

Any help on this is appreciated. 

 

Many thanks

Matt

 

1 ACCEPTED SOLUTION
vicky_
Super User
Super User

Try going back into PowerQuery and instead of duplicating the column, use a formula to add a new column.

= Table.AddColumn(Custom1, "NewColumnName", each if [Date of Status Change] = "" then [Date of Activity Logged] else [Date of Activity Logged])

I'm not sure where the most recent of the two dates fits in, but you can use List.Max({[Date of Status Change]}&{[Date of Activity Logged]}) to adjust the formula above if I missed something.

View solution in original post

1 REPLY 1
vicky_
Super User
Super User

Try going back into PowerQuery and instead of duplicating the column, use a formula to add a new column.

= Table.AddColumn(Custom1, "NewColumnName", each if [Date of Status Change] = "" then [Date of Activity Logged] else [Date of Activity Logged])

I'm not sure where the most recent of the two dates fits in, but you can use List.Max({[Date of Status Change]}&{[Date of Activity Logged]}) to adjust the formula above if I missed something.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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