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
Ah_saaah01
Helper I
Helper I

How to work with minutes and seconds with DAX

Hi please help, how to write the DAX formula to generate a list like the following running day number + 24 hours for the whole year (day 366), maybe includes seconds in every hours...

 

Day 1, 0:00

Day 1, 1:00

Day 1, 2:00

.....

Day 1, 23:00

Day 2, 0:00

Day 2, 1:00

...

Day 366, 23:00

 

Thank you for any tips:) 

1 ACCEPTED SOLUTION
ppm1
Solution Sage
Solution Sage

I would usually do this in the query editor with M, but here is one way to do it with DAX.

DateHour =
ADDCOLUMNS (
    ADDCOLUMNS (
        GENERATESERIES ( 0, 365 * 24, 1 ),
        "DateTime",
            DATE ( 2023, 1, 1 )
                + ROUNDDOWN ( [Value] / 24, 0 )
                + TIME ( [Value], 0, 0 )
    ),
    "Day", DAY ( [DateTime] ),
    "DayHr",
        "Day " & DAY ( [DateTime] ) & ", "
            & HOUR ( [DateTime] ) & " hr"
)

ppm1_0-1676380671138.png

 

Pat

Microsoft Employee

View solution in original post

2 REPLIES 2
Ah_saaah01
Helper I
Helper I

Thank you Pat:) Would be nice to know the same in M too, if you have time.

ppm1
Solution Sage
Solution Sage

I would usually do this in the query editor with M, but here is one way to do it with DAX.

DateHour =
ADDCOLUMNS (
    ADDCOLUMNS (
        GENERATESERIES ( 0, 365 * 24, 1 ),
        "DateTime",
            DATE ( 2023, 1, 1 )
                + ROUNDDOWN ( [Value] / 24, 0 )
                + TIME ( [Value], 0, 0 )
    ),
    "Day", DAY ( [DateTime] ),
    "DayHr",
        "Day " & DAY ( [DateTime] ) & ", "
            & HOUR ( [DateTime] ) & " hr"
)

ppm1_0-1676380671138.png

 

Pat

Microsoft Employee

Helpful resources

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

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.

Top Solution Authors