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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Patryk_PL_92
Helper I
Helper I

PQ - Mixed date types in one column mm/dd/yyyy and dd/mmm/yyyy

Hello,

 

I pull data from Sharepoint folder which contains many CSV files, all files got same layout.

There is a problem with dates, as shown on below image.

 

Some dates are read by PQ correctly - as mm/dd/yyyy, but some are in incorrect format dd/mmm/yyyy.

 

How can I unify those dates, to have only the desired type which is mm/dd/yyyy?

I have no idea what approach can I take, what kind of transformation can I do to achieve that...

 

Initially this column is in "ANY" data type, when I change to "DATE/TIME" format then PQ throws an error, saying:
"We couln't parse the input provided as a DateTime value."

 

Patryk_PL_92_0-1651665856179.png

 

1 ACCEPTED SOLUTION

You need to put this formula in a custom column not in formula bar. If you want to put in formula bar, then use following formula where Previous step should be replaced with your previous step

= Table.AddColumn(#"Previous Step", "Custom", each Date.From(Text.Select(Text.BeforeDelimiter([Date Column]," ",{0, RelativePosition.FromEnd}),{"0".."9","/","a".."z","A".."Z"," "})))

View solution in original post

4 REPLIES 4
Vijay_A_Verma
Super User
Super User

Use this formula to convert your existing values to date format (Change Date Column appopriately)

= Date.From(Text.Select(Text.BeforeDelimiter([Date Column]," ",{0, RelativePosition.FromEnd}),{"0".."9","/","a".."z","A".."Z"," "}))

 

You need to put this formula in a custom column not in formula bar. If you want to put in formula bar, then use following formula where Previous step should be replaced with your previous step

= Table.AddColumn(#"Previous Step", "Custom", each Date.From(Text.Select(Text.BeforeDelimiter([Date Column]," ",{0, RelativePosition.FromEnd}),{"0".."9","/","a".."z","A".."Z"," "})))

Hi Vijay,

 

amazing formula, worked well for most of records 🙂

I found out that some dates are corrupted, so I needed to clean that up in the source.

 

Accepted as Solution.

Hello Vijay
thanks for response on that

I tried to use your formula, but it does not work for me or simply I do not know how to use it.

 

This is my column name and type:

Patryk_PL_92_0-1651735046495.png

 

And this is error I get when I use that formula - it seems that formula is not identifying [Execution Date] as a column name:

Patryk_PL_92_2-1651735307676.png

 

Any tips how to implement that correctly?

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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