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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
samw5
Helper II
Helper II

Azure Analytics to SQL -- issue with datetime data type

I was running a PowerBI against and Azure Workspace log but due to the amount of data that I had to fetch across multiple tenants I decided to import it into a local SQL server.

 

I was able to update my PowerBI query (rather than having to redo all the steps and visual which remains the same) first step with the new source.


The data is populating just fine but I am getting some errors on the datetime data fields. 
I initially pulled everything as a string but then changed all date and time to "datetime" datatype in my SQL DB tables. 

I'm still getting the following error on the date columns:

Expression.Error: The type of the value does not match the type of the column.

 

Looking at the steps in the error I am getting the following:

 

= let
tableWithOnlyPrimitiveTypes = Table.SelectColumns(Source, Table.ColumnsOfType(Source, {type nullable number, type nullable text, type nullable logical, type nullable date, type nullable datetime, type nullable datetimezone, type nullable time, type nullable duration})),
recordTypeFields = Type.RecordFields(Type.TableRow(Value.Type(tableWithOnlyPrimitiveTypes))),
fieldNames = Record.FieldNames(recordTypeFields),
fieldTypes = List.Transform(Record.ToList(recordTypeFields), each [Type]),
pairs = List.Transform(List.Positions(fieldNames), (i) => {fieldNames{i}, (v) => if v = null or Value.Is(v, fieldTypes{i}) then v else error [Message = "The type of the value does not match the type of the column.", Detail = v], fieldTypes{i}})
in
Table.TransformColumns(Source, pairs)

 

Is there an easy way to reconcile the data types or check to see what the data types pulled from Azure where set to?

2 REPLIES 2
samw5
Helper II
Helper II

And I just verified my datatypes, datetime is what the Azure workspace logs show for datetime. 
I also matched strings to nvarchar and int to int so everything should be matching technically.

@samw5 Has the problem been solved?
If not, after the first source step, is there a Changed Type step which is automatically generated by Query Editor? Does this step has any error? If there is any column having an error in this step, remove the error column's change-type M code in the step, then add a separate step below it to try to change the data type of this column to see whether it is able to be changed correctly.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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