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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
agd50
Helper V
Helper V

Change text date to a date type

agd50_0-1767759409323.png

How can I change this column to a date? 

DDMMYYYY (Australian date)

 

1 ACCEPTED SOLUTION
agd50
Helper V
Helper V

I used this YouTube video - which I found it to be a great informative resource.

https://www.youtube.com/watch?v=JJFiPtmqPAg 

View solution in original post

6 REPLIES 6
agd50
Helper V
Helper V

I used this YouTube video - which I found it to be a great informative resource.

https://www.youtube.com/watch?v=JJFiPtmqPAg 

AlienSx
Super User
Super User

Table.TransformColumns(Source, {"DateText", (x) => Date.FromText(x, [Format = "ddMMyyyy"])})
cengizhanarslan
Super User
Super User

Since your values are text in DDMMYYYY format, Power BI won’t auto-detect them as dates. You need to explicitly parse them.

 

Do this in Power Query, not DAX.

  1. Select the column

  2. Transform → Extract → Text Range

    • Day: start 0, length 2

    • Month: start 2, length 2

    • Year: start 4, length 4

  3. Add a Custom Column:

= #date(
    Number.FromText([Year]),
    Number.FromText([Month]),
    Number.FromText([Day])
)

 

  • Set the new column’s type to Date

  • Remove the original text column if needed

 

_________________________________________________________
If this helped, ✓ Mark as Solution | Kudos appreciated
Connect on LinkedIn | Follow on Medium
AI-assisted tools are used solely for wording support. All conclusions are independently reviewed.
sergievs
Frequent Visitor

let
Origen = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjA3MDcyMDJVitUBckwNzOAcQ1MDUwTH3MAEzjEyNTBGUmZoBOHEAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Columna1 = _t]),
#"Tipo cambiado" = Table.TransformColumnTypes(Origen,{{"Columna1", type text}}),
Personalizado1 = Table.TransformColumns (#"Tipo cambiado",{{"Columna1", each Text.Combine ( Splitter.SplitTextByLengths({2,2,4})(_),"/")}}),
#"Tipo cambiado1" = Table.TransformColumnTypes(Personalizado1,{{"Columna1", type date}})
in
#"Tipo cambiado1"

sergievs_0-1767777229744.png

sergievs_1-1767777239820.png

 

 

SundarRaj
Super User
Super User

Hi @agd50 ,

Please have a look at the code below. Let me know if this is what you required as the end product. Thanks!

Code:
let
Source = Table.FromRows(
Json.Document(
Binary.Decompress(
Binary.FromText("i45WMjA1NDIyMDJVitUBcwyROQZIHANLCCcWAA==", BinaryEncoding.Base64),
Compression.Deflate
)
),
let
_t = ((type nullable text) meta [Serialized.Text = true])
in
type table [Dates = _t]
),
Type = Table.TransformColumnTypes(Source, {{"Dates", type text}}),
DateType = Table.AddColumn(
Type,
"Date",
each #date(
Number.From(Text.End(_[Dates], 4)),
Number.From(Text.End(Text.Start(_[Dates], 4), 2)),
Number.From(Text.Start(_[Dates], 2))
)
),
ChangeLocaleToAus = Table.TransformColumnTypes(DateType, {{"Date", type date}}, "en-AU")
in
ChangeLocaleToAus

 

Regards,

Sundar Rajagopalan

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.