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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
M_SBS_6
Helper V
Helper V

Date Format

Hi, I'm importing a PDF into power bi but the date withing the PDF is formatted as 1/22/2024. 

 

Within Power Query I tried to change to a Date but it errors: 

DateFormat.error: we couldn't parse thr input provided as a Date value.

 

Any idea how to resolve this please? 

1 ACCEPTED SOLUTION
v-yaningy-msft
Community Support
Community Support

Hi, @M_SBS_6 


According to your description, you have an error in converting the time format, according to my test, the format "1/22/2024" can be converted normally. You can try the following to solve the problem.
1. Please check whether all the data formats of your date columns are unified.

PDF:

vyaningymsft_1-1708928759692.png

Test:

vyaningymsft_0-1708928745382.png

2. If the format is uniform, you can modify the query in Power BI Advanced Editor to use the 'Date.FromText' function to specify the format of the date string. For example, if the date is formatted as 'M/dd/yyyyy' (e.g., '1/22/2024'), the following M code can be used:

let
Source = ... ,
ConvertedDate = Table.TransformColumns(Source, {"YourDateColumnName", each Date.FromText(_, "en-US", "M/dd/yyyy"), type date})
in
ConvertedDate

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

2 REPLIES 2
v-yaningy-msft
Community Support
Community Support

Hi, @M_SBS_6 


According to your description, you have an error in converting the time format, according to my test, the format "1/22/2024" can be converted normally. You can try the following to solve the problem.
1. Please check whether all the data formats of your date columns are unified.

PDF:

vyaningymsft_1-1708928759692.png

Test:

vyaningymsft_0-1708928745382.png

2. If the format is uniform, you can modify the query in Power BI Advanced Editor to use the 'Date.FromText' function to specify the format of the date string. For example, if the date is formatted as 'M/dd/yyyyy' (e.g., '1/22/2024'), the following M code can be used:

let
Source = ... ,
ConvertedDate = Table.TransformColumns(Source, {"YourDateColumnName", each Date.FromText(_, "en-US", "M/dd/yyyy"), type date})
in
ConvertedDate

 

Best Regards,
Yang
Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

PijushRoy
Super User
Super User

Hi @M_SBS_6 

Can you please see the below ticket
https://community.fabric.microsoft.com/t5/Desktop/how-to-format-dates-of-different-excel-files-in-po...


I have attached pbix file in this ticket to correct the date format.


Let me know if that works for you


If your requirement is solved, please mark THIS ANSWER as SOLUTION ✔️ and help other users find the solution quickly. Please hit the ThumbUp 👍 button if this comment helps you.

Thanks
Pijush
Linkedin




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





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! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.