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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Trying to use the Calculate function to filter out orders on SubCat2 that has FILLLER only

Trying to use the Calculate function to filter out the orders on the SubCat2 field that have "Filler" only and do not have any other SubCat values associated with it.  

 

I have this so far but am getting orders with Molding, Finish Panel, etc associated with that order number included. 

Measure = CALCULATE(DISTINCTCOUNT('DW Manufacturing'[Customer Orders Manufactured.Control ID Key]), ('DW Manufacturing'[Finished Goods Ordered.Product Sub Category2] = "FILLER"))  
 
Example:  Order 12635610 has a Filler associated and a molding associated in the SubCat 2 field.   I am looking for orders that only have Filler and no other associations. 
 
CustOrderExample.png
 
1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

Create a measure  (you should really shorten the column names to make life a bit easier)

CountSubCat = CALCULATE(COUNT(TableJ[Sub cat]), ALLEXCEPT(TableJ, TableJ[Control ID Key]))

You then pull Control ID Key on to a table visual with the measure ( and Sub category if you need it ).

Use the visual filters pane to choose "Filler" for sub category.

If the CountSubCat is equal to 1 -> that's the winner.  And there were none in the sample picture.

Hope it helps.  Also can you post data rather than a picture next time.  It always helps.

View solution in original post

1 REPLY 1
HotChilli
Super User
Super User

Create a measure  (you should really shorten the column names to make life a bit easier)

CountSubCat = CALCULATE(COUNT(TableJ[Sub cat]), ALLEXCEPT(TableJ, TableJ[Control ID Key]))

You then pull Control ID Key on to a table visual with the measure ( and Sub category if you need it ).

Use the visual filters pane to choose "Filler" for sub category.

If the CountSubCat is equal to 1 -> that's the winner.  And there were none in the sample picture.

Hope it helps.  Also can you post data rather than a picture next time.  It always helps.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.