Forum Discussion
Phoenix538
4 years agoFrequent Visitor
Calculate with filters
So I have a brain teaser (for me). I have a target value per month. And a turnover table. The turnover has multiple divisions. So made another table with divisions and a share. I.e. D1 = 50% so ...
- 4 years ago
From your code it looks like the filter is being placed on Turnover[Division] whereas it needs to be placed on 'Divisions'[Division]. If you can, create a one-to-many relationship from 'Divisions'[Division] to 'Turnover'[Division] and use that on the filter / slicer.
If you can't do that, you can try
Selected Target = CALCULATE(SUM(Target[Target])) * CALCULATE(SUM(Divisions[Share]), TREATAS( VALUES('Turnover'[Division]), 'Divisions'[Division])
johnt75
Super User
4 years agoFrom your code it looks like the filter is being placed on Turnover[Division] whereas it needs to be placed on 'Divisions'[Division]. If you can, create a one-to-many relationship from 'Divisions'[Division] to 'Turnover'[Division] and use that on the filter / slicer.
If you can't do that, you can try
Selected Target = CALCULATE(SUM(Target[Target])) * CALCULATE(SUM(Divisions[Share]), TREATAS( VALUES('Turnover'[Division]), 'Divisions'[Division])Phoenix538
4 years agoFrequent Visitor
You're a genius, that worked out perfectly. I am also glad you understood my explanation 🙂