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
gvg
Post Prodigy
Post Prodigy

Power Query working standalone, but not in function

Hi,

I have this function that calculates column total and places it on every row. It works OK if it is placed in the stand-alone query, but it fails when placed into a function.

 

= Table.AddColumn(#"Removed Columns", "Inv sum", each List.Sum ( #"Removed Columns"[#"Q-ty"] ))

I end up with this error message: "Expression.Error: We cannot apply operator - to types Text and Text."

 

How do I go around this?

1 ACCEPTED SOLUTION
gvg
Post Prodigy
Post Prodigy

Well, it turns out that one has to be careful with column format definition. If you have column in general format, it adds up ok in stand-alone query, but fails if the query is organized as a function. When I define column as Decimal or Integer it all works as expected both in stand-alone query and function.

View solution in original post

2 REPLIES 2
gvg
Post Prodigy
Post Prodigy

Well, it turns out that one has to be careful with column format definition. If you have column in general format, it adds up ok in stand-alone query, but fails if the query is organized as a function. When I define column as Decimal or Integer it all works as expected both in stand-alone query and function.

Hi @gvg,

 

It seems that you have solved your problem, please accept the your replies making sense as solution to your question so that people who may have the same question can get the solution directly.

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
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.