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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Tanmayjain077
New Member

Expression.Error: We cannot convert the value 1 to type Text. Details: Value=1 Type=[Type]

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: -Error ScreenshotError Screenshot

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.

1 ACCEPTED SOLUTION
v-yalanwu-msft
Community Support
Community Support

Hi, @Tanmayjain077 ;

You could try to change 1 to "1",

vyalanwumsft_0-1663316680252.png

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.

 

View solution in original post

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

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.

v-yalanwu-msft
Community Support
Community Support

Hi, @Tanmayjain077 ;

You could try to change 1 to "1",

vyalanwumsft_0-1663316680252.png

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.

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors