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
Surm
Helper III
Helper III

Formatting date columns while preserving data type

Hello,

 

Is there a way to format datetime columns to any other formats besides the formats listed in Power BI Desktop while preserving the datatype? Please see the screenshot below. 

 

date format.PNG

 

Using the "FORMAT()" function doesn't seem to be an option because it changes the data type to "text".

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

Hey,

 

Power BI Desktop provides the possibility to create custom format while preserving the date or datetime datatype.

 

The picture below demonstrates how this can be achieved:image.png

 

It all starts with the Model view (1).

You are able to define your own format by using the available abbreviations in the text field (4).

Here is a simple table visual that shows the format:

image.png

 

Hopefully, this provides what you are looking for.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

5 REPLIES 5
TomMartens
Super User
Super User

Hey,

 

Power BI Desktop provides the possibility to create custom format while preserving the date or datetime datatype.

 

The picture below demonstrates how this can be achieved:image.png

 

It all starts with the Model view (1).

You are able to define your own format by using the available abbreviations in the text field (4).

Here is a simple table visual that shows the format:

image.png

 

Hopefully, this provides what you are looking for.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Hi @TomMartens ,


Please see the below screenshots.
When X axis is set to "Continous", it does not obey the custom format.

 

Type=CategoricalType=CategoricalType=Continous (does not obey custom format)Type=Continous (does not obey custom format)

Hey @Surm , 

 

maybe you want to create an issue here: issues.powerbi.com

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

Hi @amitchandak ,

 

How do we show a date in a custom format in visuals, say "Mon 12/03/2015" while preserving its data type to date?

 

I am afraid, the links you provided were not relevant to the question. I am happy to be wrong on this.

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.

Top Solution Authors