<?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 DAX expression inside a PBI Role - Use string variable with delimited values for the IN clause value in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-expression-inside-a-PBI-Role-Use-string-variable-with/m-p/826679#M5820</link>
    <description>&lt;P&gt;&lt;BR /&gt;Within a Power BI Role's DAX filter expression, is it possible to pass a local DAX variable that has a delimited string of values to an IN clause i.e [ColumnName] in&amp;nbsp; { "Event A", "Event B", "Event C" }. [ColumnName] is one of the columns of the underlying imported data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The DAX code checks ok but the filter does not work. No data is returned giving the perception that the IN clause did not like the passed delimited string variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the patterns mentioned on this post &lt;A href="https://community.powerbi.com/t5/Desktop/DAX-how-split-a-string-by-delimiter-into-a-list-or-array/m-p/559615#M263888" target="_blank"&gt;https://community.powerbi.com/t5/Desktop/DAX-how-split-a-string-by-delimiter-into-a-list-or-array/m-p/559615#M263888&lt;/A&gt;&amp;nbsp;Definitely very helpful and learnt a few more DAX concepts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Code looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[ColumnName] in&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;var IncomingString = "Program Name 1; Program Name 2"&lt;/P&gt;&lt;P&gt;var StringAsPath =&amp;nbsp; SUBSTITUTE (IncomingString , ";", "|" )&lt;BR /&gt;var NoOfValues = PATHLENGTH (StringAsPath )&lt;BR /&gt;var MyTable =&lt;BR /&gt;&amp;nbsp;ADDCOLUMNS (&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GENERATESERIES (1, NoOfValues&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "ProgramName", PATHITEM (StringAsPath, ''[Value], TEXT)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;RETURN&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CONCATENATEX (MyTable, [ProgramName], ",")&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I hard code the PBI Role's DAX filter as [ColumnName] in {"Program Name 1, Program Name 2"} then it filters the data correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know what I might be doing wrong or whether this is not even possible inside a Power BI Role's DAX expression. Thanks in advance&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="31" data-lia-user-login="TomMartens" class="lia-mention lia-mention-user"&gt;TomMartens&lt;/a&gt;&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="42973" data-lia-user-login="Zubair_Muhammad" class="lia-mention lia-mention-user"&gt;Zubair_Muhammad&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Oct 2019 21:31:11 GMT</pubDate>
    <dc:creator>kv</dc:creator>
    <dc:date>2019-10-23T21:31:11Z</dc:date>
    <item>
      <title>DAX expression inside a PBI Role - Use string variable with delimited values for the IN clause value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-expression-inside-a-PBI-Role-Use-string-variable-with/m-p/826679#M5820</link>
      <description>&lt;P&gt;&lt;BR /&gt;Within a Power BI Role's DAX filter expression, is it possible to pass a local DAX variable that has a delimited string of values to an IN clause i.e [ColumnName] in&amp;nbsp; { "Event A", "Event B", "Event C" }. [ColumnName] is one of the columns of the underlying imported data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The DAX code checks ok but the filter does not work. No data is returned giving the perception that the IN clause did not like the passed delimited string variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used the patterns mentioned on this post &lt;A href="https://community.powerbi.com/t5/Desktop/DAX-how-split-a-string-by-delimiter-into-a-list-or-array/m-p/559615#M263888" target="_blank"&gt;https://community.powerbi.com/t5/Desktop/DAX-how-split-a-string-by-delimiter-into-a-list-or-array/m-p/559615#M263888&lt;/A&gt;&amp;nbsp;Definitely very helpful and learnt a few more DAX concepts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Code looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[ColumnName] in&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;var IncomingString = "Program Name 1; Program Name 2"&lt;/P&gt;&lt;P&gt;var StringAsPath =&amp;nbsp; SUBSTITUTE (IncomingString , ";", "|" )&lt;BR /&gt;var NoOfValues = PATHLENGTH (StringAsPath )&lt;BR /&gt;var MyTable =&lt;BR /&gt;&amp;nbsp;ADDCOLUMNS (&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GENERATESERIES (1, NoOfValues&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "ProgramName", PATHITEM (StringAsPath, ''[Value], TEXT)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;RETURN&lt;BR /&gt;&amp;nbsp;&amp;nbsp; CONCATENATEX (MyTable, [ProgramName], ",")&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I hard code the PBI Role's DAX filter as [ColumnName] in {"Program Name 1, Program Name 2"} then it filters the data correctly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know what I might be doing wrong or whether this is not even possible inside a Power BI Role's DAX expression. Thanks in advance&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="31" data-lia-user-login="TomMartens" class="lia-mention lia-mention-user"&gt;TomMartens&lt;/a&gt;&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="42973" data-lia-user-login="Zubair_Muhammad" class="lia-mention lia-mention-user"&gt;Zubair_Muhammad&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 21:31:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-expression-inside-a-PBI-Role-Use-string-variable-with/m-p/826679#M5820</guid>
      <dc:creator>kv</dc:creator>
      <dc:date>2019-10-23T21:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: DAX expression inside a PBI Role - Use string variable with delimited values for the IN clause value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-expression-inside-a-PBI-Role-Use-string-variable-with/m-p/828744#M5905</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="28952" data-lia-user-login="kv" class="lia-mention lia-mention-user"&gt;kv&lt;/a&gt; ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how about you change this&lt;/P&gt;&lt;PRE&gt;CONCATENATEX (MyTable, [ProgramName], ",")&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;to this&lt;/P&gt;&lt;PRE&gt;SUMMARIZE(MyTable, [ProgramName])&lt;/PRE&gt;&lt;P&gt;and drop the curly brackets&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;BR /&gt;Sturla&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this post helps, then please consider Accepting it as the solution. Kudos are nice too.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 14:21:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-expression-inside-a-PBI-Role-Use-string-variable-with/m-p/828744#M5905</guid>
      <dc:creator>sturlaws</dc:creator>
      <dc:date>2019-10-25T14:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: DAX expression inside a PBI Role - Use string variable with delimited values for the IN clause value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-expression-inside-a-PBI-Role-Use-string-variable-with/m-p/828967#M5917</link>
      <description>&lt;P&gt;That's brilliant &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="88633" data-lia-user-login="sturlaws" class="lia-mention lia-mention-user"&gt;sturlaws&lt;/a&gt;&amp;nbsp; Thank you. :)&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 19:31:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-expression-inside-a-PBI-Role-Use-string-variable-with/m-p/828967#M5917</guid>
      <dc:creator>kv</dc:creator>
      <dc:date>2019-10-25T19:31:13Z</dc:date>
    </item>
  </channel>
</rss>

