Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Filtering Filter That Contains Product Name

Hey All,

 

I have a shopping list of different customers.

IDProducts Bought
1Prod_1
1Prod_2
1Prod_3
1Prod_4
2Prod_3
2Prod_3
3Prod_2
3Prod_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

  • Icey's avatar
    Icey
    Community 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.

     

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Icey 

      Perfect! Thank you very very much 

  • Anonymous , Product 3 is sold to all the customers? what is the problem?

    Can you share sample output in table format?

    • Anonymous's avatar
      Anonymous
      Not 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