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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
Ximarin
New Member

DataFormat.Error: We couldn't parse the input provided as a Date value - Ok, but WHERE?

Hi all,

 

I import a ton a files.

There is one file that has a text value in the date column that causes the query to break.

All good, thisis not the problem.

 

Problem is that I'd want to know WHAT file is causing this.

None of the files error out when the custom function is applied.

 

It's when I actually load the data that the error stops the query and I can't figure out the file causing this.

I only get the nasty yellow error message, no further details except for the string that is the non-date-value.

 

How would I find the file causing this?

 

Thanks,  Tobias

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Ximarin ,

 

Since Power Query does a truncate of the values and only shows the values for 1000 rows if your files have a lot of data then you won't be able to check the error.

 

I suggest that before you do the formatting to date you add a new column with the following code:

try Date.FromText ([YourDateColumn]) otherwise "ERROR"

This will return values of ERROR on the incorrect ones then filter out the ones with Error and you will be able to check what are those fields, and then handle them has you may see fit.

MFelix_0-1777538950267.png

 

 

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





View solution in original post

6 REPLIES 6
v-aatheeque
Community Support
Community Support

Hi @Ximarin 

Have you had a chance to look through the responses shared earlier? If anything is still unclear, we’ll be happy to provide additional support.

 

Hi 

We wanted to follow up to check if you’ve had an opportunity to review the previous responses. If you require further assistance, please don’t hesitate to let us know.

 

 

pcoley
Solution Sage
Solution Sage

@Ximarin 
In Power BI (specifically within the Power Query M language), the try...otherwise construct is the primary method for handling errors during data transformation. It functions similarly to the IFERROR function in Excel, allowing you to define a fallback value if a calculation or step fails.
The basic sintax is : try [Expression] otherwise [FallbackValue]
Therefore you can try to handle Conversion Errors: Useful when converting to dates where some cells may contain non-date data. (Taking into account the solution given by @MFelix) Try to convert all the columns that are supposed to have date types using a [FallbackValue] that returns a fixed rare date (a date; not a text like "error"); then you can go to the data loaded into powerbi and filter the data that have that rare date; for example 1jan1900:

try Date.From([YourDateColumn]) otherwise #date(1900, 1, 1)

 

 

If I helped solve your problem, mark this post as a solution.
Kudos are Welcome! | AI assisted for clarity of wording. |
pcoley
Solution Sage
Solution Sage

@ Ximarin, 
In powerquery: Please try changing the column profile (selecting to preview the steps with all the dataset and not only the top 1000 rows) so you can see what happens with all data in the powerquery canvas before loading the data to power bi; therefore i expect you can check where the error is.

pcoley_0-1777844062388.png

 

If I helped solve your problem, mark this post as a solution.
Kudos are Welcome! | AI assisted for clarity of wording. |
Protype83
Frequent Visitor

Hey, 

 

What is format of those files? 

 

If it is text/csv file then there might be just delimiter in wrong position. 

Tab delimiter can be hard to spot. 

MFelix
Super User
Super User

Hi @Ximarin ,

 

Since Power Query does a truncate of the values and only shows the values for 1000 rows if your files have a lot of data then you won't be able to check the error.

 

I suggest that before you do the formatting to date you add a new column with the following code:

try Date.FromText ([YourDateColumn]) otherwise "ERROR"

This will return values of ERROR on the incorrect ones then filter out the ones with Error and you will be able to check what are those fields, and then handle them has you may see fit.

MFelix_0-1777538950267.png

 

 

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português





Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

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.