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
jtc
Frequent Visitor

Converting Period Points to Date and Time

Hello,

 

I have some data beginning on 1/1/2019 at 00h00. That date and time are given the number 1. The next data point is at 1/1/2019 at 01h00 associated with the number 2, and so on.

 

I'm looking for a way to convert each number associated with a date and time to the real date and time.

 

Does anyone have an idea?

 

Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

HI @jtc ,

 

Did you means you have list of number records, their have a initialization datetime and these numbers means to hour number and you want to convert them to datetime format based on initialization and offset?

 

If this is a case, you can add a calculate column with below formula to achieve your requirement:

Datetime =
VAR init =
    DATE ( 2019, 1, 1 )
VAR offsetDay =
    INT ( ( [Value] - 1 ) / 24 )
VAR offsetHour =
    MOD ( [Value] - 1, 24 )
RETURN
    DATE ( YEAR ( init ), MONTH ( init ), DAY ( init ) + offsetDay )
        + TIME ( offsetHour, 0, 0 )

18.png

 

Regards,

Xiaoxin Sheng

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

HI @jtc ,

 

Did you means you have list of number records, their have a initialization datetime and these numbers means to hour number and you want to convert them to datetime format based on initialization and offset?

 

If this is a case, you can add a calculate column with below formula to achieve your requirement:

Datetime =
VAR init =
    DATE ( 2019, 1, 1 )
VAR offsetDay =
    INT ( ( [Value] - 1 ) / 24 )
VAR offsetHour =
    MOD ( [Value] - 1, 24 )
RETURN
    DATE ( YEAR ( init ), MONTH ( init ), DAY ( init ) + offsetDay )
        + TIME ( offsetHour, 0, 0 )

18.png

 

Regards,

Xiaoxin Sheng

jtc
Frequent Visitor

Thank you @Anonymous ,

 

It's exactly that.

 

Best regards

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors