<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: IN Operator where the string is a Field in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IN-Operator-where-the-string-is-a-Field/m-p/2982966#M100034</link>
    <description>&lt;P&gt;No its not related.&lt;BR /&gt;&lt;BR /&gt;I have 3 tables like this&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Devices&lt;/P&gt;&lt;P&gt;Applications&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Device Type to Application&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What I want to do is for each device type in Devices find out what application we should be looking for in Applications via Device to Application.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So imagine the tables have the following (simplified):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Devices:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Device ID, Device Name,&amp;nbsp; Device Type&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Applications:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Device ID, Application Name, Application Version&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Device Type to Application: (this is a table that i made myself to try and find the apps we are after based on the device type):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Device Type, Applications&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I currently have Devices tied to Applications via device ID which should give the apps per device and Device Type to Applications tied to Devices via the device type.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So for each device&amp;nbsp; in Devices their Device Type will look into Device Type to Applications to find what applications to look for and from there search in Applications (after filtering on the device id link).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The reason why there is multiple comma delim applications is because one device type can have different names for the application we are looking for depending on the year it was made.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tried to do it this way as well for Devices to applications:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Device Type A, ProdA&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Device Type A, ProdZ&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Device Type A,&amp;nbsp;ProdXY&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Device Type B, Prod2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Device Type B, Prod4&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Device Type B,&amp;nbsp;Prod53&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But I coulnt get the relationships working correctly that way hence why i bundled up the apps into a comma delimited list (hoping IN would work)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;OH and containsstring might work but there are 200,000 devices with a few hundred apps each so not sure what the performance would be.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks again for your help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Dec 2022 00:03:10 GMT</pubDate>
    <dc:creator>AdamWhittaker</dc:creator>
    <dc:date>2022-12-22T00:03:10Z</dc:date>
    <item>
      <title>IN Operator where the string is a Field</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IN-Operator-where-the-string-is-a-Field/m-p/2982653#M100016</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to find an application version based on a string of comma delimetered values. If i add the values manually in the DAX Calculated column then it works fine but if i use a field that contains the string then it doesnt not find any matches.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This works:&lt;/P&gt;&lt;P&gt;MAXX(FILTER('Applications', 'Applications'[application] IN {"ProdA", "ProdZ","ProdXY"} &amp;amp;&amp;amp; 'Applications'[id] = 'Devices All'[id]),'Applications'[version])&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but if i subsitute in a field that contains exactly the same string&amp;nbsp; "ProdA", "ProdZ","ProdXY" then it doesnt find any matches.&lt;BR /&gt;Like:&lt;/P&gt;&lt;P&gt;MAXX(FILTER('Applications', 'Applications'[application] IN {'Device Type to Application'[AppNames]} &amp;amp;&amp;amp; 'Applications'[device id] = 'Devices All'[device id]),'Applications'[version])&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I tried outputting&amp;nbsp;'Device Type to Application'[AppNames] in the same calculated columns and the output matches exactly ("ProdA", "ProdZ","ProdXY").&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So does the IN not work when you contruct a table with {} and a column name?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 19:51:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IN-Operator-where-the-string-is-a-Field/m-p/2982653#M100016</guid>
      <dc:creator>AdamWhittaker</dc:creator>
      <dc:date>2022-12-21T19:51:55Z</dc:date>
    </item>
    <item>
      <title>Re: IN Operator where the string is a Field</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IN-Operator-where-the-string-is-a-Field/m-p/2982784#M100020</link>
      <description>&lt;P&gt;Try using&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;VALUES ( 'Device Type to Application'[AppNames] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;instead of&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;{ 'Device Type to Application'[AppNames] }&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 21 Dec 2022 21:27:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IN-Operator-where-the-string-is-a-Field/m-p/2982784#M100020</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2022-12-21T21:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: IN Operator where the string is a Field</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IN-Operator-where-the-string-is-a-Field/m-p/2982807#M100021</link>
      <description>&lt;P&gt;Thanks but that would just bring back the unique field values for all rows for that column instead of trying to match the individual words within the column row.&lt;BR /&gt;&lt;BR /&gt;I am trying to find all apps that match whats in the string&amp;nbsp;&lt;SPAN&gt;"ProdA", "ProdZ","ProdXY"&amp;nbsp; so if it has ProdA then bring back that version or ProdZ then bring back that.&lt;BR /&gt;If i do&amp;nbsp;'Applications'[application] IN {"ProdA", "ProdZ","ProdXY"} then it works fine (it will look in the application table to find a row that matches either ProdA or ProdZ or ProdXY) but if i replace&amp;nbsp;{"ProdA", "ProdZ","ProdXY"} with the column that contains that string it doesnt.&lt;BR /&gt;&lt;BR /&gt;I also though maybe it doesnt like doing the IN on a column so read in the field and split it by pipe (after replacing the comma with pipe) and made a one column virtual table but that also didnt work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 21:40:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IN-Operator-where-the-string-is-a-Field/m-p/2982807#M100021</guid>
      <dc:creator>AdamWhittaker</dc:creator>
      <dc:date>2022-12-21T21:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: IN Operator where the string is a Field</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IN-Operator-where-the-string-is-a-Field/m-p/2982832#M100024</link>
      <description>&lt;P&gt;Ah, OK. That's a bit odd. I'd recommend against trying to store multiple values as a single string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is&amp;nbsp;&lt;SPAN&gt;'Device Type to Application'[AppNames] related to Applications at all? How many rows does it have?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You might be able to get away with something like the following but it's not ideal:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;CONTAINSSTRING('Device Type to Application'[AppNames], 'Applications'[application])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2022 22:07:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IN-Operator-where-the-string-is-a-Field/m-p/2982832#M100024</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2022-12-21T22:07:26Z</dc:date>
    </item>
    <item>
      <title>Re: IN Operator where the string is a Field</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IN-Operator-where-the-string-is-a-Field/m-p/2982966#M100034</link>
      <description>&lt;P&gt;No its not related.&lt;BR /&gt;&lt;BR /&gt;I have 3 tables like this&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Devices&lt;/P&gt;&lt;P&gt;Applications&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Device Type to Application&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What I want to do is for each device type in Devices find out what application we should be looking for in Applications via Device to Application.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So imagine the tables have the following (simplified):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Devices:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Device ID, Device Name,&amp;nbsp; Device Type&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Applications:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Device ID, Application Name, Application Version&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Device Type to Application: (this is a table that i made myself to try and find the apps we are after based on the device type):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Device Type, Applications&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I currently have Devices tied to Applications via device ID which should give the apps per device and Device Type to Applications tied to Devices via the device type.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So for each device&amp;nbsp; in Devices their Device Type will look into Device Type to Applications to find what applications to look for and from there search in Applications (after filtering on the device id link).&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The reason why there is multiple comma delim applications is because one device type can have different names for the application we are looking for depending on the year it was made.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tried to do it this way as well for Devices to applications:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Device Type A, ProdA&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Device Type A, ProdZ&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Device Type A,&amp;nbsp;ProdXY&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Device Type B, Prod2&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Device Type B, Prod4&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Device Type B,&amp;nbsp;Prod53&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;But I coulnt get the relationships working correctly that way hence why i bundled up the apps into a comma delimited list (hoping IN would work)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;OH and containsstring might work but there are 200,000 devices with a few hundred apps each so not sure what the performance would be.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks again for your help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 00:03:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IN-Operator-where-the-string-is-a-Field/m-p/2982966#M100034</guid>
      <dc:creator>AdamWhittaker</dc:creator>
      <dc:date>2022-12-22T00:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: IN Operator where the string is a Field</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IN-Operator-where-the-string-is-a-Field/m-p/2983098#M100044</link>
      <description>&lt;P&gt;The expanded version is likely to work better.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The IN operator only works on a list, not a string. It's possible to convert a string into a list (with a mix of SUBSTITUTE, GENERATESERIES, and PATHITEM), but that's almost certainly less efficient than CONTAINSSTRING.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Depending on what you're ultimately trying to do, it's not clear if you even need the 'Device Type to Applications' table. If it's just a helper table, then you can almost certainly do better without it.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2022 02:03:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IN-Operator-where-the-string-is-a-Field/m-p/2983098#M100044</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2022-12-22T02:03:58Z</dc:date>
    </item>
  </channel>
</rss>

