Forum Discussion
Calculate Sum using Filter
I am trying to calculate sum of specific rows in a table and using the following formula, it gives me an error of Too many arguments.
- Anonymous5 years ago
There is something wrong in your sumx funtion. The code by sumx is in format as below.
Code = SUMX(<table>, <expression>)So you add there are two tables in your code," Table1" and "FILTER(Table1)", both of them will return to tables.
For reference: SUMX
Update your code:
Delivery = SUMX(FILTER('Table1','Table1'[Items]="Steel"),[Quantity])Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 Replies
- selimovdMost Valuable Professional
Hey mohammadyousaf ,
you cannot use SUMX like this. In general SUMX is an iterative function, this means an expression is executed row by row and then the row results will be summarized.
I think you should go with CALCULATE:
Delivery = CALCULATE( [Quantity], 'Table1'[Items] = "Steel" )If you need any help please let me know.If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍Best regardsDenisBlog: WhatTheFact.biFollow me: twitter.com/DenSelimovic - AnonymousNot applicable
There is something wrong in your sumx funtion. The code by sumx is in format as below.
Code = SUMX(<table>, <expression>)So you add there are two tables in your code," Table1" and "FILTER(Table1)", both of them will return to tables.
For reference: SUMX
Update your code:
Delivery = SUMX(FILTER('Table1','Table1'[Items]="Steel"),[Quantity])Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.