Forum Discussion
Filtering Filter That Contains Product Name
Hey All,
I have a shopping list of different customers.
| ID | Products Bought |
| 1 | Prod_1 |
| 1 | Prod_2 |
| 1 | Prod_3 |
| 1 | Prod_4 |
| 2 | Prod_3 |
| 2 | Prod_3 |
| 3 | Prod_2 |
| 3 | Prod_3 |
I want to see all the Customers(ID) and all of their products(Products Bought) if i'll choose a certain product.
The current result is wrong - If I choose "Prod_3", I'll get all the customers:
Hi Anonymous ,
Try this:
1. Create another product table for slicer and do not create relationships with other tables.
Product = DISTINCT('Table'[Products Bought])2. Create a measure and use it as a visual filter, set as "is not blank".
Measure = VAR SelectedProduct = VALUES ( 'Product'[Products Bought] ) VAR t = SUMMARIZE ( FILTER ( ALL ( 'Table' ), 'Table'[Products Bought] IN SelectedProduct ), [ID] ) RETURN IF ( MAX ( 'Table'[ID] ) IN t, 1 )Best regards
Icey
If this post helps, then consider Accepting it as the solution to help other members find it faster.
4 Replies
- IceyCommunity Support
Hi Anonymous ,
Try this:
1. Create another product table for slicer and do not create relationships with other tables.
Product = DISTINCT('Table'[Products Bought])2. Create a measure and use it as a visual filter, set as "is not blank".
Measure = VAR SelectedProduct = VALUES ( 'Product'[Products Bought] ) VAR t = SUMMARIZE ( FILTER ( ALL ( 'Table' ), 'Table'[Products Bought] IN SelectedProduct ), [ID] ) RETURN IF ( MAX ( 'Table'[ID] ) IN t, 1 )Best regards
Icey
If this post helps, then consider Accepting it as the solution to help other members find it faster.
- AnonymousNot applicable
Perfect! Thank you very very much
- amitchandakSuper User
Anonymous , Product 3 is sold to all the customers? what is the problem?
Can you share sample output in table format?
- AnonymousNot applicable
hey amitchandak ,
It do not let me add a picture...
Yes Product 3 is sold for all, so I want to select "Product 3" and it will show me all ID and products.
but if i'll choose Products 4 it will show me only ID = 1 and all of his products