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! Request now

Reply
Anonymous
Not applicable

Use "WHERE IN" in DAX to filter text field

Hi, I have 2 tables as Employee and Product and I have a column called Role in the Product table and the Employee table. I'm using Role as a filter and when I select Role, the linked Products will come from the Products Table. With that products, I need to filter the same products from the Employee table.

 

Basically, In SQL terms, I have to pass the Product field in the Product table as a parameter to filter the same Products in the Employee Table.  

 

Example:

WHERE Employee.Role IN (Product.Role)

Can we use the same "WHERE IN" in DAX Measure?

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @Anonymous,

 

Not really sure on what you want if it's a measure or a calculated column or a table.

 

But you can for example create a dimension table with Roles and make a relationship between both tables, or using the LOOKUP formula to return the Employee name base on the roles.

 

In the query editor you should do a merge of the tables.

 

If you give more insight, example data and expected result I can help you better.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

4 REPLIES 4
MFelix
Super User
Super User

Hi @Anonymous,

 

Not really sure on what you want if it's a measure or a calculated column or a table.

 

But you can for example create a dimension table with Roles and make a relationship between both tables, or using the LOOKUP formula to return the Employee name base on the roles.

 

In the query editor you should do a merge of the tables.

 

If you give more insight, example data and expected result I can help you better.

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Anonymous
Not applicable

Hi @MFelix

 

Thanks for your reply.

 

basically, I'm looking for the below SQL to be converted as DAX

Select Product from Employee
Where Product IN (Select ProductName from Product where Role = @FunctionalRole)

@FunctionalRole is my slicer. By selecting the Role using the slicer, the related products in the Employee table has to be slected.

 

Thanks

Akhil

Anonymous
Not applicable

Can you Please give me the dax query which looks like this

 

i.e,

 

select products from productstable where products in(select products from customer where customerid=@customerid)

 

 

Thanks

Hi @Anonymous,

 

Correct me if I'm wrong if you have two tables Product and Employee on PBI, then just create a dimension table for the Roles with distinct values and make a relationship between this 3 tables  then on your tables measures calculated columns use the Roles table to make your filter.

 

Regards,

MFelx


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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
Top Kudoed Authors