<?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: The syntax for 'IN' is incorrect error in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-syntax-for-IN-is-incorrect-error/m-p/1563744#M31076</link>
    <description>&lt;P&gt;Thank you! Unfortunately that is what I would have had to do using SSAS 2015. I ended up adding the column in the SQL table, which IN operator is not an issue!&lt;/P&gt;</description>
    <pubDate>Mon, 21 Dec 2020 23:57:06 GMT</pubDate>
    <dc:creator>christielu</dc:creator>
    <dc:date>2020-12-21T23:57:06Z</dc:date>
    <item>
      <title>The syntax for 'IN' is incorrect error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-syntax-for-IN-is-incorrect-error/m-p/924566#M9270</link>
      <description>&lt;P&gt;I have a simple calculated column. The definition looks like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[Unit Category] :=&lt;/P&gt;&lt;PRE&gt;&lt;FONT&gt;&lt;FONT&gt;IF&lt;/FONT&gt; &lt;FONT&gt;(&lt;/FONT&gt;&lt;FONT&gt; 'Unit Information'[Unit Type] &lt;/FONT&gt;&lt;FONT&gt;IN&lt;/FONT&gt;&lt;FONT&gt; { &lt;/FONT&gt;&lt;FONT&gt;"1PAT"&lt;/FONT&gt;&lt;FONT&gt;, &lt;/FONT&gt;&lt;FONT&gt;"1BF"&lt;/FONT&gt;&lt;FONT&gt; }, &lt;/FONT&gt;&lt;FONT&gt;"Frontline Patrol"&lt;/FONT&gt;&lt;FONT&gt;, &lt;/FONT&gt;&lt;FONT&gt;"Other Support"&lt;/FONT&gt;&lt;FONT&gt; )&lt;/FONT&gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Nothing much to it. But I keep getting error message: &lt;EM&gt;&lt;FONT&gt;The syntax for 'IN' is incorrect.&amp;nbsp;&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can't figure out why? Do any of you see anything wrong with it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 23:58:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-syntax-for-IN-is-incorrect-error/m-p/924566#M9270</guid>
      <dc:creator>qaiserjaved</dc:creator>
      <dc:date>2020-02-06T23:58:37Z</dc:date>
    </item>
    <item>
      <title>Re: The syntax for 'IN' is incorrect error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-syntax-for-IN-is-incorrect-error/m-p/924580#M9272</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="56291" data-lia-user-login="qaiserjaved" class="lia-mention lia-mention-user"&gt;qaiserjaved&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Not sure why.. It gave me correct results. Attach the PBIX file to test with mockup data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You could do the same with Custom column in Query editor..&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;= if [Unit Type] = "1PAT" or [Unit Type] = "1BF" then "Frontline Patrol" else "Other Support"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it helps, mark it as a solution&lt;/P&gt;&lt;P&gt;Kudos are nice too&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 00:09:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-syntax-for-IN-is-incorrect-error/m-p/924580#M9272</guid>
      <dc:creator>VasTg</dc:creator>
      <dc:date>2020-02-07T00:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: The syntax for 'IN' is incorrect error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-syntax-for-IN-is-incorrect-error/m-p/924656#M9276</link>
      <description>I am not sure but for date dax many people got syntax error that is because of extra spaces. And seperator like comma semicolans this one because of region setting.&lt;BR /&gt;&lt;BR /&gt;For Africa semicolon is comma separator.&lt;BR /&gt;&lt;BR /&gt;Just play with it and remove those blanks and give try.&lt;BR /&gt;&lt;BR /&gt;Thanks&lt;BR /&gt;Pravin&lt;BR /&gt;&lt;BR /&gt;If it resolves your problem mark it as a solution and give Kudos.</description>
      <pubDate>Fri, 07 Feb 2020 01:56:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-syntax-for-IN-is-incorrect-error/m-p/924656#M9276</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-07T01:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: The syntax for 'IN' is incorrect error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-syntax-for-IN-is-incorrect-error/m-p/924671#M9277</link>
      <description>&lt;P&gt;Thanks for the suggestions. I need to use IN operator becuase I have a large number of different comparisons. The full expression looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" color="#000080"&gt;IF (&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Unit Information'[Unit Type] IN { "1PAT","1BF" },&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Frontline Patrol",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF (&amp;nbsp; 'Unit Information'[Unit Type]="1SGT",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Frontline Admin",&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IF (&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Unit Information'[Unit Type] IN { "2MAR","2DIVE","2EDU","2K9","2MCB","2OPS","2PSU","2RBU","2TAC","2TMED","3COAST","4MOTO","4RIDE","4RTRF","4SAP","5YED" },&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "Regional Support", "Other Support"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;)&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I shortened it to validate the syntax.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using it inside an SSAS tabular model. When I render the object in Power BI Desktop, it gives the error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried the SWITCH function. But problem with SWITCH is that it only allows a max of 10 values when used with a linked server. This is not DAX limitation but SQL Server linked server limitation.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 02:19:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-syntax-for-IN-is-incorrect-error/m-p/924671#M9277</guid>
      <dc:creator>qaiserjaved</dc:creator>
      <dc:date>2020-02-07T02:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: The syntax for 'IN' is incorrect error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-syntax-for-IN-is-incorrect-error/m-p/924751#M9278</link>
      <description>Could you try to remove blank if blanks are there or add blanks if blanks are not there.&lt;BR /&gt;&lt;BR /&gt;Also check regional seperator setting on your system.&lt;BR /&gt;&lt;BR /&gt;And make sure you are using latest version of power bi desktop and server version.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Pravin</description>
      <pubDate>Fri, 07 Feb 2020 03:24:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-syntax-for-IN-is-incorrect-error/m-p/924751#M9278</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-02-07T03:24:14Z</dc:date>
    </item>
    <item>
      <title>Re: The syntax for 'IN' is incorrect error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-syntax-for-IN-is-incorrect-error/m-p/924769#M9279</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="56291" data-lia-user-login="qaiserjaved" class="lia-mention lia-mention-user"&gt;qaiserjaved&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to use IN inside power query, refer to this post..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/IN-OPERATOR-in-PowerBi/td-p/174285" target="_blank"&gt;https://community.powerbi.com/t5/Desktop/IN-OPERATOR-in-PowerBi/td-p/174285&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If 10 elements is the limitation in SWITCH, split the case and use the same value for all the cases..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SWITCH (
TRUE(),
TEST IN {A,B,C,D),"TRUE",
TEST IN {E,F,G,H},"TRUE",
"FALSE"
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it helps, mark it as a solution&lt;/P&gt;&lt;P&gt;Kudos are nice too&lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 03:50:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-syntax-for-IN-is-incorrect-error/m-p/924769#M9279</guid>
      <dc:creator>VasTg</dc:creator>
      <dc:date>2020-02-07T03:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: The syntax for 'IN' is incorrect error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-syntax-for-IN-is-incorrect-error/m-p/1563217#M31050</link>
      <description>&lt;P&gt;Hi! I'm having the exact same problem in SSAS. I used the same statement in Excel and it works. Did you find out what's causing it? How did you end up fixing it? Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2020 17:24:09 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-syntax-for-IN-is-incorrect-error/m-p/1563217#M31050</guid>
      <dc:creator>christielu</dc:creator>
      <dc:date>2020-12-21T17:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: The syntax for 'IN' is incorrect error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-syntax-for-IN-is-incorrect-error/m-p/1563279#M31051</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="240878" data-lia-user-login="christielu" class="lia-mention lia-mention-user"&gt;christielu&lt;/a&gt;&amp;nbsp;PBI and Excel has it since late 2016 but SSAS has it from SQL server 2016 onwards, which version of SSAS are you using?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2020 18:04:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-syntax-for-IN-is-incorrect-error/m-p/1563279#M31051</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2020-12-21T18:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: The syntax for 'IN' is incorrect error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-syntax-for-IN-is-incorrect-error/m-p/1563339#M31055</link>
      <description>&lt;P&gt;Thank you Antriksh! Well that's my problem! I'm using 2015... Is there a workaround?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2020 18:30:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-syntax-for-IN-is-incorrect-error/m-p/1563339#M31055</guid>
      <dc:creator>christielu</dc:creator>
      <dc:date>2020-12-21T18:30:37Z</dc:date>
    </item>
    <item>
      <title>Re: The syntax for 'IN' is incorrect error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-syntax-for-IN-is-incorrect-error/m-p/1563447#M31065</link>
      <description>&lt;P&gt;I ended up using this format instead.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IF (&lt;BR /&gt;&amp;nbsp; 'Unit Information'[Unit Type] = "1PAT" || 'Unit Information'[Unit Type] = "1BF",&lt;BR /&gt;&amp;nbsp; "Frontline Patrol",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; IF ( 'Unit Information'[Unit Type]="1SGT",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; "Frontline Admin",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; IF (&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 'Unit Information'[Unit Type] = "2MAR" || 'Unit Information'[Unit Type] = "2DIVE" || 'Unit Information'[Unit Type] = "2EDU" || 'Unit Information'[Unit Type] = "2K9" || 'Unit Information'[Unit Type] = "2MCB" || 'Unit Information'[Unit Type] = "2OPS" || 'Unit Information'[Unit Type] = "2PSU" || 'Unit Information'[Unit Type] = "2RBU" || 'Unit Information'[Unit Type] = "2TAC" || 'Unit Information'[Unit Type] = "2TMED" || 'Unit Information'[Unit Type] = "3COAST" || 'Unit Information'[Unit Type] = "4MOTO" || 'Unit Information'[Unit Type] = "4RIDE" || 'Unit Information'[Unit Type] = "4RTRF" || 'Unit Information'[Unit Type] = "4SAP" || 'Unit Information'[Unit Type] = "5YED",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "Regional Support",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IF (&lt;BR /&gt;'Unit Information'[Unit Type] = "3BEAT" || 'Unit Information'[Unit Type] = "3BIKE" || 'Unit Information'[Unit Type] = "3CR" || 'Unit Information'[Unit Type] = "3CS" || 'Unit Information'[Unit Type] = "3NPU" || 'Unit Information'[Unit Type] = "3SE" || 'Unit Information'[Unit Type] = "4DTRF" || 'Unit Information'[Unit Type] = "4DTU" || 'Unit Information'[Unit Type] = "4SGT" || 'Unit Information'[Unit Type] = "5CIB",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "Divisional Support",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IF (&lt;BR /&gt;'Unit Information'[Unit Type] = "2STR" || 'Unit Information'[Unit Type] = "2ROB" || 'Unit Information'[Unit Type] = "5AUTO" || 'Unit Information'[Unit Type] = "5CAR" || 'Unit Information'[Unit Type] = "5DRUG" || 'Unit Information'[Unit Type] = "5FRAUD" || 'Unit Information'[Unit Type] = "5IDENT" || 'Unit Information'[Unit Type] = "5INTEL" || 'Unit Information'[Unit Type] = "5SVU",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "Investigative Support",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IF (&lt;BR /&gt;'Unit Information'[Unit Type] = "1DI" || 'Unit Information'[Unit Type] = "6CRTS" || 'Unit Information'[Unit Type] = "6CUR" || 'Unit Information'[Unit Type] = "6PE" || 'Unit Information'[Unit Type] = "6SUMM" || 'Unit Information'[Unit Type] = "6TOW" || 'Unit Information'[Unit Type] = "7ADM" || 'Unit Information'[Unit Type] = "7SENR" || 'Unit Information'[Unit Type] = "99GPS",&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; "Other Support", "Other Support"&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;BR /&gt;&amp;nbsp; &amp;nbsp; )&lt;BR /&gt;&amp;nbsp; )&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2020 20:21:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-syntax-for-IN-is-incorrect-error/m-p/1563447#M31065</guid>
      <dc:creator>qaiserjaved</dc:creator>
      <dc:date>2020-12-21T20:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: The syntax for 'IN' is incorrect error</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-syntax-for-IN-is-incorrect-error/m-p/1563744#M31076</link>
      <description>&lt;P&gt;Thank you! Unfortunately that is what I would have had to do using SSAS 2015. I ended up adding the column in the SQL table, which IN operator is not an issue!&lt;/P&gt;</description>
      <pubDate>Mon, 21 Dec 2020 23:57:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-syntax-for-IN-is-incorrect-error/m-p/1563744#M31076</guid>
      <dc:creator>christielu</dc:creator>
      <dc:date>2020-12-21T23:57:06Z</dc:date>
    </item>
  </channel>
</rss>

