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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Crav888
Frequent Visitor

Sum Multiple when filtered

Hi, 

 

I have the following data set:

 

Area  Item  Cost      

1        Yes    5

1        Yes    10

1        No    20

2        No    12 

2        Yes    13 

2        Yes     12

 

How do I achieve the following:

Sum of cost where Item is "yes" divided by Sum of cost with both "yes" and "no"?

 

It should be so easy, but I am afraid I simply can't crack it, and it is rather urgent.

 

Thank you in advance,

And happy holidays 😄

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

 

Try this

 

=CALCULATE(SUM(Data[Cost]),Data[Item]="Yes")/SUM(Data[Cost])

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Crav888,

 

Another try:

Measure =
CALCULATE ( SUM ( 'table3'[Cost] ), 'table3'[Item] = "Yes" )
    / CALCULATE ( SUM ( table3[Cost] ), ALL ( table3[Item] ) )

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ashish_Mathur
Super User
Super User

Hi,

 

Try this

 

=CALCULATE(SUM(Data[Cost]),Data[Item]="Yes")/SUM(Data[Cost])

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
mehaboob557
Resolver III
Resolver III

Hi @Crav888,

 

You have to create Measure with FIlter then like below,

 

Measure Sum of Yes = CALCULATE(SUMX(Table3,Table3[Cost]),FILTER(Table3,Table3[Item]="YES"))

Measure Sum of NO = CALCULATE(SUMX(Table3,Table3[Cost]),FILTER(Table3,Table3[Item]="NO"))



Divide measure = ([Measure Sum of Yes]/([Measure Sum of Yes]+[
Measure Sum of NO]))

If it works, Please Like(kudo) my answer and accept as solution.

 

Regard,

Mehbub

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.