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
NeilF_71
New Member

Query Error

Hi

I am getting an error all of a sudden. My dataset has not changed. Help?

 

let
Source = Indirect,
#"Detected Type Mismatches" = 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),
#"Added Index" = Table.AddIndexColumn(#"Detected Type Mismatches", "Row Number" ,1),
#"Kept Errors" = Table.SelectRowsWithErrors(#"Added Index", {"Pers.No.", "Name of employee or applicant", "Week", "Receiver WBS Element", "Job code", "Job code description", "A/AType", "Att./abs. type text", "WT", "Long text", "Loc.", "DWSCl", "CSS", "CO Period", "Rev", "Doc. no.", "PA", "Cost Ctr", "Work Order", "Date", "CATS Hours Indirect", "CO Hours", "Unit", "Compensation Type", "WBS", "Asset"}),
#"Reordered Columns" = Table.ReorderColumns(#"Kept Errors", {"Row Number", "Pers.No.", "Name of employee or applicant", "Week", "Receiver WBS Element", "Job code", "Job code description", "A/AType", "Att./abs. type text", "WT", "Long text", "Loc.", "DWSCl", "CSS", "CO Period", "Rev", "Doc. no.", "PA", "Cost Ctr", "Work Order", "Date", "CATS Hours Indirect", "CO Hours", "Unit", "Compensation Type", "WBS", "Asset"})
in
#"Reordered Columns"

0 REPLIES 0

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.