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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

How to calculate Date + time

Hello,

 

I want to calculate a date/time + time to get results in date/time. 

My data setting is following:

 

Column A: Date/time [DD:MM:YYYY hh:nn:ss]

Column B: Time [hh:nn:ss]

 

Results in column C should be 

Column A + Column B= Column C (date/time [DD:MM:YYYY hh:nn:ss])

 

I tried to set up this formula but it doesn't work.

 

Thanks for help,

Petr

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

You can use the following measure to convert Decimal number [in hours] to Time value

 

Measure =
VAR vSeconds =
    MAX ( 'Table'[Hours] ) * 3600
VAR vMinutes =
    INT ( vSeconds / 60 )
VAR vRemainingSeconds =
    MOD ( vSeconds, 60 )
VAR vHours =
    INT ( vMinutes / 60 )
VAR vRemainingMinutes =
    MOD ( vMinutes, 60 )
RETURN
    TIME ( vHours, vRemainingMinutes, vRemainingSeconds )

 

 

Capture4.PNG

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

View solution in original post

3 REPLIES 3
Pragati11
Super User
Super User

Hi @Anonymous ,

 

Is this what you are looking for:

Pragati11_0-1602237527320.png

 

Thanks,

Pragati

 

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Anonymous
Not applicable

Hi,

 

I've found the different issue.

I have the Number of hours in decimal number, which I transfer to time format. But if decimal nubmer is higher than 24, the time is then incorrect.

So I need to calculate following vallues:

 

Column A: Date/Time [dd:mm:yy hh:mm:ss]

Column B: Decimal number [in hours]

 

I need to calculate columna A + B to get result in Date/Time.

 

Thanks

Petr

Hi @Anonymous ,

 

You can use the following measure to convert Decimal number [in hours] to Time value

 

Measure =
VAR vSeconds =
    MAX ( 'Table'[Hours] ) * 3600
VAR vMinutes =
    INT ( vSeconds / 60 )
VAR vRemainingSeconds =
    MOD ( vSeconds, 60 )
VAR vHours =
    INT ( vMinutes / 60 )
VAR vRemainingMinutes =
    MOD ( vMinutes, 60 )
RETURN
    TIME ( vHours, vRemainingMinutes, vRemainingSeconds )

 

 

Capture4.PNG

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.