Forum Discussion
Use double filter when calculating a sum
- 3 years ago
Hi, ThomasSan
You can replace the [Rest] measure :
Rest = VAR _slice = VALUES('Sheet1'[Customer]) return SUMX( FILTER(ALL(Sheet1) , YEAR('Sheet1'[Order Date]) =2022 && not 'Sheet1'[Customer] in _slice ),'Sheet1'[Order Value])The result is as follows:
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi , ThomasSan
You want to show the value of the selected Customer and the value of the other Customer in the pie chart. Right?
Here are the steps you can refer to :
(1)This is my test data:
(2)We can create two measures :
Custom Value = SUMX( FILTER('Sheet1',YEAR('Sheet1'[Order Date])=2022 ) , 'Sheet1'[Order Value])Rest = SUMX( FILTER(ALL(Sheet1) , YEAR('Sheet1'[Order Date]) =2022 && 'Sheet1'[Customer] <> SELECTEDVALUE('Sheet1'[Customer]) ),'Sheet1'[Order Value])
(3)Then we can put the [Customer] in slice and the measure in the pie chart and we will meet your need :
If this method does not meet your needs, you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
- ThomasSan3 years agoHelper IV
Thank you for your response, v-yueyunzh-msft !
Unfortunately, in my description above, I failed to mention that I have more than two customers. Do you happen to know how to successfully transform the "<> SELECTEDVALUE('Sheet1'[Customer]) " bit into a list?
- v-yueyunzh-msft3 years agoCommunity Support
Hi, ThomasSan
You can replace the [Rest] measure :
Rest = VAR _slice = VALUES('Sheet1'[Customer]) return SUMX( FILTER(ALL(Sheet1) , YEAR('Sheet1'[Order Date]) =2022 && not 'Sheet1'[Customer] in _slice ),'Sheet1'[Order Value])The result is as follows:
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
- ThomasSan3 years agoHelper IV