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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
WoutD
New Member

Datetime: 24h format

Hi everyone,

 

I just started working with powerbi desktop, so don't shoot me if I say anything stupid.

Searched the forum for possible matches to my problem, but can't seem to find anything that does. So here it goes:

 

I have a mySql database that I linked to powerbi. In this database is a column with datatype "datetime". So when I look in the database it shows the datetime like this: "DD/MM/YYYY hh:mm:ss". So I think "Great, this is what I want". But then when I look in the powerbi, it has converted this to "MM/DD/YYYY hh:mm:ss AM/PM" I have no idea why the time setting is different, but it's driving me nuts. I tried to change my regional setting in options, but this didn't seem to help. Neither did changing the query datatype to "using locale".

 

I don't want to write any code to convert this because it is correct in my database... Can anyone help? Am I doing something wrong? Simple setting I missed? Thank you in advance.

 

Kind regards,

Wout

1 ACCEPTED SOLUTION
jdobrzen
Advocate II
Advocate II

It looks like a 24hour isnt available by default, so you can create a calculated column and use the following DAX to achive the time format. The capital "HH" give you the double digit 24hr.

 

24hr = FORMAT(ReportData[ImportDate],"HH:mm:ss")

 

https://msdn.microsoft.com/en-us/library/ee634398.aspx

 

View solution in original post

4 REPLIES 4
WoutD
New Member

Thanks everyone for the fast response. This works, although I still don't understand why powerBI converts the time in the first place...

Well... it's sorted out, so I'm happy.

v-jiascu-msft
Employee
Employee

Hi Wout,

 

You can change the date format settings of the OS. You will find the format you want after you restart the Desktop.

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
jdobrzen
Advocate II
Advocate II

It looks like a 24hour isnt available by default, so you can create a calculated column and use the following DAX to achive the time format. The capital "HH" give you the double digit 24hr.

 

24hr = FORMAT(ReportData[ImportDate],"HH:mm:ss")

 

https://msdn.microsoft.com/en-us/library/ee634398.aspx

 

Anonymous
Not applicable

@WoutD,

You can click on your column in the Fields pane, select Modeling ribbon on top, and go to Format section to find the format you  want for your date. If you could not find it, it means that Power BI does not support this format by default, hence you might have to write some DAX to format your date. 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.