<?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: Multiple criteria for switch statement in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiple-criteria-for-switch-statement/m-p/2631269#M76971</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;This is a formula for a calculated column&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Switch Statement =
SWITCH (
    TRUE (),
    TableName[A] = BLANK ()
        &amp;amp;&amp;amp; TableName[B] IN { 1, 2, 3, 4, 5 }, "Global",
    TableName[A]
        IN { 11, 12, 13 }
            &amp;amp;&amp;amp; OR ( TableName[B] = BLANK (), TableName[B] = 6 ), "Local",
    TableName[A] = BLANK ()
        &amp;amp;&amp;amp; OR ( TableName[B] = BLANK (), TableName[B] = 6 )
        &amp;amp;&amp;amp; NOT ( RELATED ( DIM[C] ) IN { 98, 99 } ), "Customer",
    TableName[A] = BLANK ()
        &amp;amp;&amp;amp; OR ( TableName[B] = BLANK (), TableName[B] = 6 )
        &amp;amp;&amp;amp; RELATED ( DIM[C] ) = 98, "Other",
    "NA"
)&lt;/LI-CODE&gt;</description>
    <pubDate>Mon, 11 Jul 2022 13:34:42 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2022-07-11T13:34:42Z</dc:date>
    <item>
      <title>Multiple criteria for switch statement</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiple-criteria-for-switch-statement/m-p/2631221#M76970</link>
      <description>&lt;P&gt;I'm really struggling to get my head round this SWITCH statment, may not be possible in one calculated column? I've written it in SQL below as a case statment and it works but cant do the same in DAX. I believe SWITCH would be the best function to use and have tried nesting IF statetments in there as well with no luck.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help greatly appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;case when A is null and B in ('1',2','3','4','5') then 'Global'&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; when A in ('11',12','13') and B is null or B = '6' then 'Local'&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; when A is null and B is null or B = '6' and DIM.C not in ('98','99') then 'Customer'&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; when A is null and B is null or B = '6' and DIM.C = '98' then 'Other' else 'NA' end as 'Category'&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2022 13:22:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiple-criteria-for-switch-statement/m-p/2631221#M76970</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-11T13:22:49Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple criteria for switch statement</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiple-criteria-for-switch-statement/m-p/2631269#M76971</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;BR /&gt;This is a formula for a calculated column&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Switch Statement =
SWITCH (
    TRUE (),
    TableName[A] = BLANK ()
        &amp;amp;&amp;amp; TableName[B] IN { 1, 2, 3, 4, 5 }, "Global",
    TableName[A]
        IN { 11, 12, 13 }
            &amp;amp;&amp;amp; OR ( TableName[B] = BLANK (), TableName[B] = 6 ), "Local",
    TableName[A] = BLANK ()
        &amp;amp;&amp;amp; OR ( TableName[B] = BLANK (), TableName[B] = 6 )
        &amp;amp;&amp;amp; NOT ( RELATED ( DIM[C] ) IN { 98, 99 } ), "Customer",
    TableName[A] = BLANK ()
        &amp;amp;&amp;amp; OR ( TableName[B] = BLANK (), TableName[B] = 6 )
        &amp;amp;&amp;amp; RELATED ( DIM[C] ) = 98, "Other",
    "NA"
)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 11 Jul 2022 13:34:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiple-criteria-for-switch-statement/m-p/2631269#M76971</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-07-11T13:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple criteria for switch statement</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiple-criteria-for-switch-statement/m-p/2631337#M76980</link>
      <description>&lt;P&gt;Amazing, thank you!!&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2022 14:05:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Multiple-criteria-for-switch-statement/m-p/2631337#M76980</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-11T14:05:21Z</dc:date>
    </item>
  </channel>
</rss>

