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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.