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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Format

Hi guys, I have the following question. It is probably very trivial but I want to know how to make a date from "1022020" in pbi = "01.02.2020". Thank you very much! Abba

1 ACCEPTED SOLUTION
tex628
Community Champion
Community Champion

Alright, you should be able to follow the following steps:

Starting table with two dates:
image.png

Add this custom column to make all dates 8 digit:

Column = if Text.Length([Date]) = 8 then [Date] else "0" & [Date]


Giving the following result:
image.png

Finally we add the last column to convert it to the correct format:

Column 2 = Text.Start([Column] , 2) & "." &
Text.Range([Column] , 2 , 2) & "." &
Text.End([Column] , 4)


Giving the following result:
image.png


Which you can simply convert to date:
image.png

Br,
J



Connect on LinkedIn

View solution in original post

4 REPLIES 4
v-lionel-msft
Community Support
Community Support

Hi @Anonymous ,

 

If what you want is to display the date as ‘01.02.2020’, unfortunately, the current version of Power BI(October 2020) does not support this format.

v-lionel-msft_0-1604300372578.png

 

Best regards,
Lionel Chen

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

 

tex628
Community Champion
Community Champion

Do you want the date  to remain a string/text value or do you also want it converted to datetype?

In Power Query you can use the following column:

Column = 
Text.Start([Column] , 2) & "." &
Text.Range([Column] , 2 , 2) & "." &
Text.End([Column] , 4)


In Dax you can use the following:

Column = LEFT('Table'[Column] , 2) & "." & RIGHT(LEFT('Table'[Column] , 4) , 2) & "." & RIGHT('Table'[Column] , 4)


Let me know how it goes.

/ J


Connect on LinkedIn
Anonymous
Not applicable

I want tp convert it to a date datatype.

tex628
Community Champion
Community Champion

Alright, you should be able to follow the following steps:

Starting table with two dates:
image.png

Add this custom column to make all dates 8 digit:

Column = if Text.Length([Date]) = 8 then [Date] else "0" & [Date]


Giving the following result:
image.png

Finally we add the last column to convert it to the correct format:

Column 2 = Text.Start([Column] , 2) & "." &
Text.Range([Column] , 2 , 2) & "." &
Text.End([Column] , 4)


Giving the following result:
image.png


Which you can simply convert to date:
image.png

Br,
J



Connect on LinkedIn

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.