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.
Hi dear experts,
I am facing the following error while appening the data in power query in excel -
"Expression.Error: We cannot convert the value 1 to type Text.
Details:
Value=1
Type=[Type]"
The screenshot of the error is as under: -
The entire code in Append 1 reads as under: -
let
Source = Table.Combine({CGST_Bran_Input, CGST_Input, IGST_Input}),
#"Renamed Columns" = Table.RenameColumns(Source,MappingList,MissingField.Ignore),
#"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns",Data_Type_master,MissingField.Ignore),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Changed Type", {"Gross Total", "Quantity", "Narration", "Gstin/Uin", "Voucher Ref. No.", "Voucher No.", "Voucher Type", "Particulars", "Date"}, "Attribute", "Value"),
#"Added Custom" = Table.AddColumn(#"Unpivoted Other Columns", "Category Treatment Helper", each List.PositionOf(Mapping_Treatment[Refined name],[Attribute])),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Category Treatment", each Mapping_Treatment[Treatment]{[Category Treatment Helper]}),
#"Added Custom2" = Table.AddColumn(#"Added Custom1", "Voucher Type Index", each List.PositionOf(Mapping_Voucher_Type[Voucher Type],[Voucher Type])),
#"Added Custom3" = Table.AddColumn(#"Added Custom2", "Voucher Treatment", each Mapping_Voucher_Type[Vch Treatment]{[Voucher Type Index]})
in
#"Added Custom3"
The query in Data_type_master reads as under: -
let
Source = Excel.CurrentWorkbook(){[Name="Data_Type_master"]}[Content],
#"Added Custom" = Table.AddColumn(Source, "Custom", each Value.Type(if [Type] = "date" then #date(2020,1,1) else
if [Type] = "number" then 1 else
"A")),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"Type"}),
#"Transposed Table" = Table.Transpose(#"Removed Columns"),
Custom1 = Table.ToColumns(#"Transposed Table")
in
Custom1
Unable to figure out the cause of of the error. Please help.
Solved! Go to Solution.
Hi, @Tanmayjain077 ;
You could try to change 1 to "1",
Or removing Rows that are blank.
Solved: Expression.Error: We cannot convert the value to t... - Microsoft Power BI Community
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Tanmayjain077 ;
Is your problem solved? If so, kindly mark the proper reply as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, @Tanmayjain077 ;
You could try to change 1 to "1",
Or removing Rows that are blank.
Solved: Expression.Error: We cannot convert the value to t... - Microsoft Power BI Community
Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.