Forum Discussion
SUMMARIZE error The expression refers to multiple columns... cannot be converted to a scalar value
- 10 years ago
You seem to have 2 commas, I have highlighted and underlined that part.
calculate(sum(ChargeActivity[Invoice Price])), , "CostpRow", calculate(sum(MTpAcct[Cost/Row])))
Just change that to one comma :)... The error is basically saying that yo have specified one extra arguement or one less, because of the redundant comma.
The problem is that Summarize returns a table and you are trying to assign it to a scalar value (a measure).
Where are you trying to display the result? If you just drag and drop the Total Price in your columns with Account and Date on the rows, you will automatically get the total price for each account/date combination.
If you want the same value to be repeated for each account/date combination even if other columns are there, then you need to do something like
calculate(SUM(ChargeActivity[Invoice Price]), ALLEXCEPT(ChargeActivity, ChargeActivity[Date], ChargeActivity[Account Id])
Or if you just want the sum of total price for each account/date combination regardless of what is there on rows, you will have to do something like a
SUMX(CROSSJOIN(values(Date), values(Account)), calculate(SUM(ChargeActivity[Invoice Price])) , etc...
If you tell me your requirements in detail with some source data and the result, I might be able to help you better
your comment saved my life, easy to understand and easy to fix 🙂