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! Learn more

Reply
Saniat
Helper V
Helper V

Using PATHCONTAINS and SELECTEDVALUE

Hi,

I have an items table, and a product table.

In the product table I have a column where all the items required to build the product is listed in A_B_C fashion.

Saniat_0-1671612934980.png


I have created a calculated column like below and tried to use this as a filter to show products which includes those items, but it did not work:

ItemRequired =

PATHCONTAINS ( 'ProductTable'[Items], SELECTEDVALUE ( 'ItemTable'[ItemID] ) ))

Ideally I would like to show ItemName to the user, and in the background will take the selected ItemID, match if that ID is present in Items column of the ProductTable, and want to show only the products those satisfiy this condition.

Can someone help me to point out the problem in this approach ?

Thanks.
1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Saniat 

 

You can try the following methods.

Measure = 
Var _N1=SEARCH(SELECTEDVALUE('Item'[ItemID]),SELECTEDVALUE('Product'[Items]),1,0)
Return
IF(_N1>0,1,0)

Put measure in the filter of this view and set it equal to 1.

vzhangti_0-1671676876166.png

vzhangti_1-1671676996980.pngvzhangti_2-1671677011673.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @Saniat 

 

You can try the following methods.

Measure = 
Var _N1=SEARCH(SELECTEDVALUE('Item'[ItemID]),SELECTEDVALUE('Product'[Items]),1,0)
Return
IF(_N1>0,1,0)

Put measure in the filter of this view and set it equal to 1.

vzhangti_0-1671676876166.png

vzhangti_1-1671676996980.pngvzhangti_2-1671677011673.png

Is this the result you expect?

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

+Also wondering if I want to create a measure out of the Products, how do I apply this Item filtering ? 

Saniat_0-1672235929433.png

 

Thanks for that !
Just wondering will it be possible to let the user choose the ItemName, instead of ItemID ?
Thanks

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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