Forum Discussion
Anonymous
6 years agoNot applicable
SUM Filtered
Hey, I'm stuck on something I think should be simple but im going a bit mad getting there. I want to sum a total of everything in a table, where column A = the value of the current row. So if column ...
Greg_Deckler
Community Champion
6 years agoAnonymous - So generally you are going to use SUMX(FILTER('Table'), [Column] = "Something"),[Value]) or CALCULATE(SUM('Table'[Value]),FILTER('Table',[Column] = "Something"))
- Anonymous6 years agoNot applicable
Thanks Greg. The problem I have is getting it to ignore existing filters. I tried this, but it seems to just think forever as soon as i add the all()
POAccrualValue =VAR REMARK = SELECTEDVALUE('Account Items (F0911)'[Name - Remark Explanation])RETURNCALCULATE('Account Items (F0911)'[AccountItemValue],FILTER(all('Account Items (F0911)'),'Account Items (F0911)'[Name - Remark Explanation]=REMARK))- Greg_Deckler6 years ago
Community Champion
Anonymous - I can't make heads or tails of that formula because it doesn't seem to relate back to the sample data.
With your sample data as reference, if you have "Fruit" in a visual, you could do this:
Measure = VAR __Fruit = MAX('Table'[Fruit]) RETURN SUMX(FILTER(ALL('Table'),'Table'[Fruit] = __Fruit),[Cost]) or Measure = VAR __Fruit = MAX('Table'[Fruit]) RETURN CALCULATE(SUM('Table'[Cost]),FILTER(ALL('Table'),'Table'[Fruit]=__Fruit))