<?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: Error message for SWITCH function in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-message-for-SWITCH-function/m-p/1985188#M43853</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;I see two problems potentially. One, in the last line, you seem to be missing a TIME function, TIME(21, 30, 00). Two, if this is a measure, you are missing aggregations around your column references. Time Sent.&lt;/P&gt;</description>
    <pubDate>Wed, 28 Jul 2021 15:55:20 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2021-07-28T15:55:20Z</dc:date>
    <item>
      <title>Error message for SWITCH function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-message-for-SWITCH-function/m-p/1985134#M43848</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried to use the SWITCH function to replace nested multiple IF statements here. My goal is to categorize the times emails were sent into Morning, Afternoon, Evening, etc.&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;Regardless of me creating this function as a New Measure or a New Column, the same error message kept appearing.&lt;/P&gt;&lt;P&gt;"Operator or expression '()' is not supported in this context."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried writing the formula with and without indents, replaced the "" part at the end into BLANK(), but nothing has worked yet...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd really appreciate your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 15:25:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-message-for-SWITCH-function/m-p/1985134#M43848</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-28T15:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: Error message for SWITCH function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-message-for-SWITCH-function/m-p/1985188#M43853</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;I see two problems potentially. One, in the last line, you seem to be missing a TIME function, TIME(21, 30, 00). Two, if this is a measure, you are missing aggregations around your column references. Time Sent.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Jul 2021 15:55:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-message-for-SWITCH-function/m-p/1985188#M43853</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2021-07-28T15:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: Error message for SWITCH function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-message-for-SWITCH-function/m-p/1985644#M43868</link>
      <description>&lt;P&gt;Hi Greg,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've corrected my function following your suggestions:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Segment = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SWITCH ( &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;TRUE(),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MIN('Publication Subscriber'[Time Sent]) &amp;gt;= TIME(00,00,00) &amp;amp;&amp;amp; MIN('Publication Subscriber'[Time Sent]) &amp;lt; TIME(08,00,00),"Early Morning", &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MIN('Publication Subscriber'[Time Sent]) &amp;gt;= TIME(08,00,00) &amp;amp;&amp;amp; MIN('Publication Subscriber'[Time Sent]) &amp;lt; TIME(12,00,00),"Morning", &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MIN('Publication Subscriber'[Time Sent]) &amp;gt;= TIME(12,00,00) &amp;amp;&amp;amp; MIN('Publication Subscriber'[Time Sent]) &amp;lt; TIME(17,30,00),"Afternoon", &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MIN('Publication Subscriber'[Time Sent]) &amp;gt;= TIME(17,30,00) &amp;amp;&amp;amp; MIN('Publication Subscriber'[Time Sent]) &amp;lt; TIME(21,30,00),"Evening", &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MIN('Publication Subscriber'[Time Sent]) &amp;gt;= TIME(21,30,00) &amp;amp;&amp;amp; MIN('Publication Subscriber'[Time Sent]) &amp;lt; TIME(00,00,00),"Late Evening",&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;BLANK() &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;It worked! Thank you for your help!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Best.&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 28 Jul 2021 20:28:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Error-message-for-SWITCH-function/m-p/1985644#M43868</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-28T20:28:19Z</dc:date>
    </item>
  </channel>
</rss>

