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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Frequent Visitor

Error in Date Field

Hi all!!


I have a really strange case.

My datasource is Google Sheet with many data (like 1 mln) for multiple dates.

While loading it to Power BI I am geeting errors on Date fields.


Why is that? Because in one case data field in alligned to right and on the other to left.








Is this even possible to have this kind of error based on formating?

Super User
Super User

Alignment to the left indicates the data is text. Alignment to the right indicates the data is numeric or datetime. The date of 8th October likely has spaces preceeding or following it which leaves it being interpreted as text. The following will convert all rows to datetime. It works by

  1. Testing the type of the raw date to see if it is datetime.
  2. If it is datetime then return the raw date.
  3. If it is not datetime assume it is text.
    1. Trim the text and
    2. Convert it to datetime.
= Table.AddColumn(
#"Name of Previous Step",
"Datetime", each
if ( Type.Is( Value.Type([Raw Date]), DateTime.Type) )
then [Raw Date]
else DateTime.From( Text.Trim([Raw Date]) ),
type datetime)

 Here is my Google Sheet,


and  here is my result in Power Query (I am working in UK local so my date format is day, month, year).



Resolver II
Resolver II


  It may be some space issue. Try trim(inside the format) in the column.




Helpful resources

Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City


Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors