Forum Discussion
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.
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 =
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.
Hi, Anonymous
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.
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
3 Replies
- v-zhangtiCommunity Support
Hi, Anonymous
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.
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
- AnonymousNot applicable
Thanks for that !
Just wondering will it be possible to let the user choose the ItemName, instead of ItemID ?
Thanks - AnonymousNot applicable
+Also wondering if I want to create a measure out of the Products, how do I apply this Item filtering ?