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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Faberz
Frequent Visitor

calculate a subset of items

Hello Everybody,

 

I have just started using PowerBI Desktop and DAX and I am struggling with something.

 

I have a table that looks like this:

ProductRevenue
Special a 1
b 2
c 3
Special d 4
Special e5
f 6
 7
etc. 8

 

I would like to calculate the revenue of all products with the attribute special, the revenue of the total revenue (all products) and the revenue of all products minus those with the label "Special".

 

I though of using the CALCULATE + SUM functions but I can't figure out how to limit the calculation to only the product with Special. I tried to use the FILTER funcion but with no success.

 

Apologies if the question is very naive. I have started using this tool a couple of week ago and I am still learning the basics.

Thank you in advance for the help.

 

 

 

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Faberz , Try measure like

 

calculate(Sum(Table[Revenue]) ) - calculate(Sum(Table[Revenue]), filter(Table, Search("Special", Table[Product],,0) >0 ))

 

or

 

calculate(Sum(Table[Revenue]) , all(Table[Product]) ) - calculate(Sum(Table[Revenue]), filter(all(Table[Product]), Search("Special", Table[Product],,0) >0 ))   

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Faberz , Try measure like

 

calculate(Sum(Table[Revenue]) ) - calculate(Sum(Table[Revenue]), filter(Table, Search("Special", Table[Product],,0) >0 ))

 

or

 

calculate(Sum(Table[Revenue]) , all(Table[Product]) ) - calculate(Sum(Table[Revenue]), filter(all(Table[Product]), Search("Special", Table[Product],,0) >0 ))   

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak 

Thank you for the answer Man! It seems to work.

Mind if I ask you another question?

Is Search actually returning the position (mean as "row position") of the item in the product column? What is

the purpose of the ">0" at the end? 

 

Thank you again for the help and for making a total beginner a little less of a beginner 😉 

 

 

 

 

 

 

 

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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 Solution Authors