Forum Discussion

Phoenix538's avatar
Phoenix538
Frequent Visitor
4 years ago
Solved

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 ...
  • johnt75's avatar
    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])