Forum Discussion
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.
Using the "FORMAT()" function doesn't seem to be an option because it changes the data type to "text".
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:
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:
Hopefully, this provides what you are looking for.
Regards,
Tom
5 Replies
- TomMartensSuper 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:
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:
Hopefully, this provides what you are looking for.
Regards,
Tom
- AnonymousNot applicable
Hi TomMartens ,
Please see the below screenshots.
When X axis is set to "Continous", it does not obey the custom format.Type=CategoricalType=Continous (does not obey custom format)
- TomMartensSuper User
Hey Anonymous ,
maybe you want to create an issue here: issues.powerbi.com
Regards,
Tom
- amitchandakSuper User
- AnonymousNot applicable
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.