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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Calculate end date column from start date and length

Please, how to calculate end date column if known only start date and length of the event in seconds? 

ISSUE_KEYSTART_DATEFROM_STATESTATEIN_STATEEND_DATE
A24/09/2019 07:14EstimationIn Progress2 
B21/05/2019 21:25DraftOpen56987 
C20/02/2018 12:13In ProgressReview8899965 
D27/02/2019 09:38OpenDefinition65 
E24/09/2019 17:15Ready for DevelopmentIn Progress4 
1 ACCEPTED SOLUTION

You can add a custom column with this formula to get your desired result (assume [Start Time] is DateTime format.

 

=[START_DATE] + #duration(0,0,0,[IN_STATE])

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@Anonymous , use dateadd

As a new column

end date = dateadd([start date], [add second],second)

https://docs.microsoft.com/en-us/dax/dateadd-function-dax

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
Anonymous
Not applicable

I am getting error: The last argument must be one of these keywords: DAY, MONTH, QUARTER, or YEAR.

So there is no other way to do that unless length column convert to days?

Anonymous
Not applicable

and when the length column (IN_STATE) recalcualte to days, I am getting another error: A date column containing duplicate dates was specified in the call to function 'DATEADD'. This is not supported.

Anonymous
Not applicable

So far I was able to solve it only via workaround in Power Query Editor, by adding two custom columns - one for converting the length in socnds to whole days (decimal number is not acceptet in Date.AddDays formula; and the second for adding end date using Date.AddDays. But this solution is not precisie to seconds. 

You can add a custom column with this formula to get your desired result (assume [Start Time] is DateTime format.

 

=[START_DATE] + #duration(0,0,0,[IN_STATE])

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors