Forum Discussion
Sum by Group
- 7 years ago
Sure. You've got a slight mistake in how you're setting up the query. Remember, FILTER returns a table, so use that for the table you're summing across in your SUMX. I just replaced the first '2018 RAW Data' term with your FILTER term:
SalesTotal = SUMX(FILTER('2018 RAW Data', '2018 RAW Data'[advice] = SELECTEDVALUE('2018 RAW Data'[advice]) && '2018 RAW Data'[Key] = SELECTEDVALUE('2018 RAW Data','2018 RAW Data'[Key])), '2018 RAW Data'[Sales Amount])I think there are other issues (like you name a table then a column in your second SELECTEDVALUE when you only need the column), but this should get you started.
Hi,
Thank you so much for your suggestion.
Please see below my formula is giving me an error,Can any one suggest?
ERROR:"Too many arguments were passed to the SUMX function. The maximum argument count for the function is 2."
SalesTotal = SUMX('2018 RAW Data','2018 RAW Data'[Sales Amount],
FILTER('2018 RAW Data','2018 RAW Data'[advice]=
SELECTEDVALUE('2018 RAW Data'[advice]) && '2018 RAW Data'[Key]=
SELECTEDVALUE('2018 RAW Data','2018 RAW Data'[Key])))
Sure. You've got a slight mistake in how you're setting up the query. Remember, FILTER returns a table, so use that for the table you're summing across in your SUMX. I just replaced the first '2018 RAW Data' term with your FILTER term:
SalesTotal = SUMX(FILTER('2018 RAW Data', '2018 RAW Data'[advice] = SELECTEDVALUE('2018 RAW Data'[advice]) && '2018 RAW Data'[Key] = SELECTEDVALUE('2018 RAW Data','2018 RAW Data'[Key])), '2018 RAW Data'[Sales Amount])
I think there are other issues (like you name a table then a column in your second SELECTEDVALUE when you only need the column), but this should get you started.
- Anonymous7 years agoNot applicable
Thank you so much for your Help and Explaniation.