cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kadapavel
Helper II
Helper II

Calendar with date and time (HH:MM:SS)

Hello

I'm trying to have calendar with "YYYY,MM,DD" and "HH:MM:SS"

First part is done with 

Date = 
ADDCOLUMNS (
CALENDAR (DATE(2016,1,1), DATE(2018,12,31)),
"DateDate"     , FORMAT ( [Date], "MM/DD/YYYY" ),
"Year"              , FORMAT( [Date], "YYYY" ),
"Monthnumber"       , FORMAT ( [Date], "MM" ),
"YearMonthnumber"   , FORMAT ( [Date], "YYYY/MM" ),
"YearMonthShort"    , FORMAT ( [Date], "YYYY/mmm" ),
"MonthNameShort"    , FORMAT ( [Date], "mmm" ),
"MonthNameLong"     , FORMAT ( [Date], "mmmm" ),
"DayOfWeekNumber"   , WEEKDAY ( [Date] ),
"DayOfWeek"         , FORMAT ( [Date], "dddd" ),
"DayOfWeekShort"    , FORMAT ( [Date], "ddd" ),
"Quarter"           , "Q" & FORMAT ( [Date], "Q" ),
"YearQuarter"       , FORMAT ( [Date], "YYYY" ) & "/Q" & FORMAT ( [Date], "Q" )
)

Second part I'm stugling with

Who can help to make calendar including hours, minutes and seconds?

BR

Pavel

1 ACCEPTED SOLUTION
v-sihou-msft
Microsoft
Microsoft

@kadapavel

 

I highly recommend you make Date calendar table and Time part table separated. You can imagine that if you want to get "hh:mm:ss" for every single date, you will get a 24*60*60 times huge table than your existing Date table. So just Create a Time table with Hour, Minute, Seconds, etc columns in your data model. 

 

Please also see this article: 

 

Data Import Best Practices in Power BI

 

Regards,

View solution in original post

1 REPLY 1
v-sihou-msft
Microsoft
Microsoft

@kadapavel

 

I highly recommend you make Date calendar table and Time part table separated. You can imagine that if you want to get "hh:mm:ss" for every single date, you will get a 24*60*60 times huge table than your existing Date table. So just Create a Time table with Hour, Minute, Seconds, etc columns in your data model. 

 

Please also see this article: 

 

Data Import Best Practices in Power BI

 

Regards,

Helpful resources

Announcements
collabdays lisbon

CollabDays Lisbon - 26 November 2022

Sessions include practical, hands-on experience that will help you take the next step in your career and know-how.

Difinity Conference

Difinity Conference 2022

Difinity is the largest Microsoft Data, AI, Power BI, Power Platform and Business Applications Conference in New Zealand.

European Share Point Conference

European Share Point Conference

This conference returns live and in-person in Copenhagen this 28 November-01 December with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Microsoft 365 Conference â__ December 6-8, 2022

Microsoft 365 Conference - 06-08 December

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.