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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
KieuVuong
Frequent Visitor

Lookup Value with 2 matched criteria

Hi guys, 

I am newbie in power BI, finding the way to use DAX and I have two table as pictures below

 

Product Table

KieuVuong_0-1669237344879.png

 

Campaign Table

KieuVuong_1-1669237376377.png

 

Question is: in the first table, I would like to have one new column named "Campaign" and

- for Article 10, the content of new column would be adidas_female (which matches one campaign in the Campaign Table)

- for Articles 11: Nike_kids

- for articles 12: Null ( as we dont have campaign micheal kors in kids in Campaign Table)

- for articles 13: Nike_kids

- for articles 14: adidas_female

- for articles 15: Null (as we dont have campaign Guess for female)

 

Could you please instruct me on that? Thank you a lot in advance!!

 

1 ACCEPTED SOLUTION

@Bifinity_75 Thank a lot for your help.

 

But this code only matches the Brand, doesnt matches the Gender.

 

For example, for article 10, it shows adidas_kids (which is not correct), it should be adidas_female.

 

However, I try to learn your logic and code, I change it to:

 

Result1 =

 maxx(filter('Campaign Table' , search('Product Table'[Brands] & "_" &'Product Table'[Gender], 'Campaign Table'[Campaign],,0)>0),'Campaign Table'[Brand] & "_" & 'Campaign Table'[Gender])
 
The result is:
 
KieuVuong_1-1669283100202.png

Thank you so much!

 

View solution in original post

2 REPLIES 2
Bifinity_75
Solution Sage
Solution Sage

Hi @KieuVuong , create this calculate column:

Result= 
maxx(filter('Campaign Table' , search('Campaign Table'[Brand],'Product Table'[Brands],,0)>0),'Campaign Table'[Brand] & "_" & 'Campaign Table'[Gender])

 

- The result:

Bifinity_75_0-1669239843354.png

 

Best Regards

@Bifinity_75 Thank a lot for your help.

 

But this code only matches the Brand, doesnt matches the Gender.

 

For example, for article 10, it shows adidas_kids (which is not correct), it should be adidas_female.

 

However, I try to learn your logic and code, I change it to:

 

Result1 =

 maxx(filter('Campaign Table' , search('Product Table'[Brands] & "_" &'Product Table'[Gender], 'Campaign Table'[Campaign],,0)>0),'Campaign Table'[Brand] & "_" & 'Campaign Table'[Gender])
 
The result is:
 
KieuVuong_1-1669283100202.png

Thank you so much!

 

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.