Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon'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.
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."
Solved! Go to 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"," "})))
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:
And this is error I get when I use that formula - it seems that formula is not identifying [Execution Date] as a column name:
Any tips how to implement that correctly?
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
14 | |
13 | |
12 | |
12 | |
12 |