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
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
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