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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Top Solution Authors
Top Kudoed Authors