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
ajpaul
Frequent Visitor

Count based on a lookup with multiple criteria - DAX

Hi,

 

I have a table of data which contains two columns.  One is FPItemID which details the finished product item ID and the other is RMItemID which details the raw material item id that goes into making this finished product.

 

An example dataset is below:

FPItemIDRMItemID
101001
101002
101003
101004
101005
101006
101007
101008
101009
101010
101011
201001
201002
201003
201004
201005
201006
201011
201012
201013
201014
201015
301001
301003
301004
301005
301006
301007
301008
301009
301019
301020
301021
301022

 

I am relatively new to DAX but am struggling to create the solution I am looking for.  I would like to be able to select a finished product ID and then compare the raw material ID associated with that finished product ID against all the other raw materials ID associated with the other finished product IDs.  The idea being that it would return a list of finished product ids and a count of common raw materials IDs that they share.  The ultimate aim would also be to see which raw material IDs were common accross the finished product IDs.

 

For example in the dataset above if I selected FPItemID 10 i would want to see that there are 7 common raw material IDs in FPitem 20 and 8 common raw material IDs with FPItem 30.  Again if it is possible to see which raw material item IDs are common as well that would be great.

 

Thanks for the help with this.


AJ

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Would you be satisfied with a visual solution?  Create a Matrix visual, put the products in the columns and the raw material in the rows. Then put the raw materials in the values and change the aggregation to count.

 

Annotation 2020-07-01 094342.png

 

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

Would you be satisfied with a visual solution?  Create a Matrix visual, put the products in the columns and the raw material in the rows. Then put the raw materials in the values and change the aggregation to count.

 

Annotation 2020-07-01 094342.png

 

I never even considered this option!

 

Thanks a lot for your help.


AJ

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.

Top Solution Authors