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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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

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
Microsoft Employee
Microsoft 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 III
Advocate III

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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