This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
I get the following error message when editing a query in Power BI.
"A type mismatch has been detected."
I don't know where in the table is the type mismatch.
Is there any way to find out where it should be fixed?
----------------------------------------------------------------
= 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 value type does not match the column type." , Detail = v], fieldTypes{i}})
in
Table.TransformColumns(source, pairs)
---------------------------------------------------------
Translated with www.DeepL.com/Translator (free version)
Hi @igoto ,
What is your data source? I think it may be a data type error, you can try to format all the columns as text, then change the data type one by one, and check which column causes this error.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
what is behind "source" ?
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 3 |