Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Phoenix538
Frequent 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 a value of 0,5. Total of the values is 1 (100%)

 

What I want is when the user uses the filters to show the turnover for 1 division, that it will multiply the value of the target with the share of the selected division.

 

So if turnover is 20 million and the target was 18 Million, but the user will filter on only Division 1 (D1). Power BI will then use the sum of the selected division share (which is 0,5 int his case) to show the value of 9 Million. 

I somehow cannot find how I can make this work. 

The table with the share is a simple one:

DivisionShare
D10,5
D20,25
D30,25

 

I currently use this as a calculation: 

Selected Target = CALCULATE(SUM(Target[Target])) * CALCULATE(SUM(Divisions[Share]),ALLSELECTED(Turnover[Division]))
1 ACCEPTED SOLUTION
johnt75
Super User
Super User

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])

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

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])

You're a genius, that worked out perfectly. I am also glad you understood my explanation 🙂

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors