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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
dolevh
Helper II
Helper II

Dates Column with two different columns

Table Name: Projects

 

ProjectID      Active   StartDate   EndDate   New Column 
1   1   1/1/2019   1/3/2021   1/3/2021
2   1   5/5/2019   (Blank)   5/5/2020
3   1   3/7/2020   3/9/2021   3/9/2021
4   1   1/7/2020   (Blank)   1/7/2021
5   1   2/9/2020   (Blank)   2/9/2021
6   1   10/9/2020   5/1/2021   5/1/2021
7   1   11/11/2020   6/6/2021   6/6/2021
8   0   12/01/2021   (Blank)   (Blank)
9   0   7/6/2021   (Blank)   (Blank)

 

It's my data, I'm looking for a solution to this situation.  

If my Projects[End Date] is Blank so I will take the column Projects[Start Date] + 365 days only if Projects[Active] = 1 if is Projects[End Date] with the date so I will keep these dates in the new column.

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @dolevh ,

 

Try this in a custom column:

if [EndDate] = null and [Active] = 1 then Date.AddDays([StartDate], 365)
else [EndDate]

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

2 REPLIES 2
dolevh
Helper II
Helper II

It's working!

Thank you @BA_Pete 

BA_Pete
Super User
Super User

Hi @dolevh ,

 

Try this in a custom column:

if [EndDate] = null and [Active] = 1 then Date.AddDays([StartDate], 365)
else [EndDate]

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.