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
mrtn
Helper II
Helper II

Change date format in DIRECT Query Mode - not on list of selectable formats

Hi, 

 

I would like to use the format dd/MM/yyyy HH:mm for my datetime column in DirectQuery mode. This format is not on the list of available datetime formats. 

 

Using a calculated column with FORMAT(TableName[timestamp],"dd/MM/yyyy HH:mm") does not work, as I get the following error "Function 'FORMAT' is not allowed as part of calculated column DAX expressions on DirectQuery models."

 

Any workarounds? Can I somehow enable custom formats?

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @mrtn ,

You can change DateTime type in Power Query Editor.

= Text.From(Date.Day([SalesDate]))&"/"&Text.From(Date.Month([SalesDate]))&"/"&Text.From(Date.Year([SalesDate]))&" "&Text.From(Time.Hour([SalesDate]))&":"&Text.PadStart(Text.From(Time.Minute([SalesDate])),2,"0")

Change date format in DIRECT Query Mode - not on list of selectable formats 3.png

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

7 REPLIES 7
ToddFischer
New Member

I am having problems where the date format that isa coming in is "  friday, august 27, 2021" - but I need this to read 08/27/2021

ToddFischer_0-1649879487998.png

I do not have the ability to get into the dataset since it is direct query, and it is not giving me the option to change the format....

 

Help please.....

Todd

 

Icey
Community Support
Community Support

Hi @mrtn ,

You can change DateTime type in Power Query Editor.

= Text.From(Date.Day([SalesDate]))&"/"&Text.From(Date.Month([SalesDate]))&"/"&Text.From(Date.Year([SalesDate]))&" "&Text.From(Time.Hour([SalesDate]))&":"&Text.PadStart(Text.From(Time.Minute([SalesDate])),2,"0")

Change date format in DIRECT Query Mode - not on list of selectable formats 3.png

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

how to I ge tot power query editor if I do not have the ability to get into the table?

ToddFischer_0-1649879886028.png

 

On second thought - it appeared to resolve the issue at first glance. However, I get the message "This query contains transformations that can't be used for DirectQuery."

 

I accepted the proposed solution without proper testing...

 

@Icey 

Icey
Community Support
Community Support

Hi @mrtn ,

If your time is with the same minutes, for example, '9:00' and '10:00', you can change the expression like this:

= Table.AddColumn(#"Removed Columns", "Custom", each Text.From(Date.Day([SalesDate]))&"/"&Text.From(Date.Month([SalesDate]))&"/"&Text.From(Date.Year([SalesDate]))&" "&Text.From(Time.Hour([SalesDate]))&":00")

Change date format in DIRECT Query Mode - not on list of selectable formats - follow.png

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

ToddFischer_1-1649879927023.png

 

Thanks!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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!

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
Top Kudoed Authors