Forum Discussion

Yuiitsu's avatar
Yuiitsu
Icon for Helper V rankHelper V
3 years ago
Solved

Error message: detected type mismatches

Dear PowerBI experts,

 

Please help me as I keep getting this error message : 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)

 

My applied steps doesnt change the type:

 

I cannot figure out where is this error from which column. 

Please advise!

  • the solution is in last lines 

     "The type of the value does not match the type of the column."

     

    you should check the columns datatype and the values that you are inserting in your column. 

2 Replies

  • the solution is in last lines 

     "The type of the value does not match the type of the column."

     

    you should check the columns datatype and the values that you are inserting in your column. 

  • tb0493's avatar
    tb0493
    Frequent Visitor

    I'm getting similar errors and it's only when I upgraded to the Feb 2024 version of PBI