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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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