Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

How to use DAX Filter using IN with String Parameter ?

Hi All,

I want to add a custom column to a table B with certain calculation to get the maximum value on a product from another table A, however each event_venue_id in the table B might have different products mapping.

 

This is the source table A for calculation (i created a column called productid_string with datatype Text) :

 

I've prepared the list of products mapping for each event_venue_id, by adding column productidlist in table B like this :

 

the result in table B (column productidlist)

 

Then I create the custom column in table B (ITR M-3) to get maximum value of product like this.

When I fetched the values into a variable and use it within filter it wont' work using double quotes, then i tried to test manually using unichar(34) and it works.

 

 

Can someone help me how to fix the parameter or how to filter using multiple values of product id?

 

Thank You

 

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    One, having a bit of trouble following this one. Sample data as text would help recreate. Expected output from that source data would also help. You have a lot of it in the post but there are some missing elements. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

     

    For example, I don't understand where those funky quotes are coming from. Can you strip those out in Power Query? It's very odd to have those in the data.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hello @alvinyurisman ,

    Do you want to get the maximum product number from each hospital at the same time? For example: hospitalid 88790, the expected value of ITR M-3 is 96? Has any relationship been created between table A and table B? If yes, what field is the connected field?

    max product.JPG

    Best regards

    Rena