<?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: A table of multiple values was supplied when a single value was expected in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ERROR-A-table-of-multiple-values-was-supplied-when-a-single/m-p/1213618#M19575</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a look at the video for customer churn analysis&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=h9kRwgamLcw" target="_blank"&gt;https://www.youtube.com/watch?v=h9kRwgamLcw&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;HN&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jul 2020 05:38:02 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-07-10T05:38:02Z</dc:date>
    <item>
      <title>ERROR: A table of multiple values was supplied when a single value was expected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ERROR-A-table-of-multiple-values-was-supplied-when-a-single/m-p/1212607#M19544</link>
      <description>&lt;P&gt;I have a customer sales table of 2018 and 2019 sales only. The Sales Date has a relationship to a DATE dimension table. I am trying to write a DAX measure will give me a count of distinct Customer ShipTo numbers for those customers who made a purchase in 2019 but not 2018. I'm trying to follow DAX code patterns that are decribed in various blog entries by several well know DAX programmers. Below is my code. There is no error when creating the measure. But when I add it to a visual I get the error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'A table of multiple values was supplied when a single value was expected'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure where the problem is since CALCULATE is being asked to return a scalar.&amp;nbsp; Any help is appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Acquired Customers = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;COUNTROWS(VALUES( VwCOPA[ShipTo] ) ), &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VALUES(VwCOPA[ShipTo]), &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VwCOPA[ShipTo] &amp;lt;&amp;gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATETABLE ( VALUES( VwCOPA[ShipTo]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER( all('Date'[Date]), DATESBETWEEN('Date'[Date], DATE(2018,1,1),DATE(2018,12,31))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;), ALL('Date'[Date]) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&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;</description>
      <pubDate>Thu, 09 Jul 2020 17:01:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ERROR-A-table-of-multiple-values-was-supplied-when-a-single/m-p/1212607#M19544</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-09T17:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: A table of multiple values was supplied when a single value was expected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ERROR-A-table-of-multiple-values-was-supplied-when-a-single/m-p/1213125#M19563</link>
      <description>&lt;P&gt;I don't think this part&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;VwCOPA[ShipTo] &amp;lt;&amp;gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATETABLE&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;is possible.&amp;nbsp; Any particular reason for not using EXCEPT() in this scenario? It seems to be uniquely suited to answer your question.&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 09 Jul 2020 22:39:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ERROR-A-table-of-multiple-values-was-supplied-when-a-single/m-p/1213125#M19563</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-07-09T22:39:21Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: A table of multiple values was supplied when a single value was expected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ERROR-A-table-of-multiple-values-was-supplied-when-a-single/m-p/1213618#M19575</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a look at the video for customer churn analysis&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=h9kRwgamLcw" target="_blank"&gt;https://www.youtube.com/watch?v=h9kRwgamLcw&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;HN&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 05:38:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ERROR-A-table-of-multiple-values-was-supplied-when-a-single/m-p/1213618#M19575</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-10T05:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: A table of multiple values was supplied when a single value was expected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ERROR-A-table-of-multiple-values-was-supplied-when-a-single/m-p/1215096#M19606</link>
      <description>&lt;P&gt;Thanks for your reply Lbendin. I was using &amp;lt;&amp;gt; CALCULATEDTABLE because I found that construct in this article (in the second code listing there for Acquired Customers):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://javierguillen.wordpress.com/2012/08/24/determining-customer-retention-in-dax/" target="_blank"&gt;https://javierguillen.wordpress.com/2012/08/24/determining-customer-retention-in-dax/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have re-written my code using the EXCEPT function as per below. But, like my first code, it shows no errors when i create it but when I add it to a visual I get the same error of:&amp;nbsp;&lt;SPAN&gt;'A table of multiple values was supplied when a single value was expected'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Acquired Customers = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;COUNTROWS ( VALUES ( VwCOPA[ShipTo] ) ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;EXCEPT (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VALUES ( VwCOPA[ShipTo] ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATETABLE (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VALUES ( VwCOPA[ShipTo] ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ALL ( 'Date'[Date] ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DATESBETWEEN ( 'Date'[Date], DATE ( 2018, 1, 1 ), DATE ( 2018, 12, 31 ) )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ALL ( 'Date'[Date] )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 15:14:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ERROR-A-table-of-multiple-values-was-supplied-when-a-single/m-p/1215096#M19606</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-10T15:14:47Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: A table of multiple values was supplied when a single value was expected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ERROR-A-table-of-multiple-values-was-supplied-when-a-single/m-p/1215114#M19607</link>
      <description>&lt;P&gt;DATESBETWEEN is returning a list of dates and you are not applying any aggregation over it, you can use this.&lt;/P&gt;&lt;LI-CODE lang="php"&gt;Acquired Customers =
CALCULATE (
    COUNTROWS ( VALUES ( VwCOPA[ShipTo] ) ),
    EXCEPT (
        VALUES ( VwCOPA[ShipTo] ),
        CALCULATETABLE (
            VALUES ( VwCOPA[ShipTo] ),
            FILTER (
                ALL ( 'Date'[Date] ),
                'Date'[Date] &amp;gt; DATE ( 2008, 1, 1 )
                    &amp;amp;&amp;amp; 'Date'[Date] &amp;lt; DATE ( 2008, 12, 31 )
            ),
            ALL ( 'Date'[Date] )
        )
    )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 10 Jul 2020 15:23:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ERROR-A-table-of-multiple-values-was-supplied-when-a-single/m-p/1215114#M19607</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2020-07-10T15:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: A table of multiple values was supplied when a single value was expected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ERROR-A-table-of-multiple-values-was-supplied-when-a-single/m-p/1215122#M19608</link>
      <description>&lt;P&gt;HI&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Acquired Customers :=
COUNTROWS (
    FILTER (
        ADDCOLUMNS (
            VALUES ( VwCOPA[ShipTo] ),
            "PreviousPurchase", CALCULATE (
                COUNTROWS ( VwCOPA ),
                FILTER (
                    ALL ( VwCOPA ),
                    Date[Year] = 2018
                )
            ),
            "CurrentPurchase", CALCULATE (
                COUNTROWS ( VwCOPA ),
                FILTER (
                    ALL ( VwCOPA ),
                    Date[Year] = 2019
                )
            )
        ),
        [PreviousPurchase] = 0
            &amp;amp;&amp;amp; [CurrentPurchase] &amp;lt;&amp;gt; 0
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Harsh Nathani&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 15:26:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ERROR-A-table-of-multiple-values-was-supplied-when-a-single/m-p/1215122#M19608</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-10T15:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: A table of multiple values was supplied when a single value was expected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ERROR-A-table-of-multiple-values-was-supplied-when-a-single/m-p/1215158#M19611</link>
      <description>&lt;P&gt;Thanks Harshnathani. This is helpful. As I sift through all the ways to use the various functions, and all the possible code patterns, I know I need to settle on the most optimal ones.&amp;nbsp; I think some of the code patterns I have found online are now rather old.&amp;nbsp;I will experiment with what you have shown.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2020 15:42:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ERROR-A-table-of-multiple-values-was-supplied-when-a-single/m-p/1215158#M19611</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-10T15:42:22Z</dc:date>
    </item>
    <item>
      <title>Re: ERROR: A table of multiple values was supplied when a single value was expected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ERROR-A-table-of-multiple-values-was-supplied-when-a-single/m-p/1218817#M19755</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;SPAN&gt;Antriksh. This makes sense now!&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;John&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2020 15:21:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ERROR-A-table-of-multiple-values-was-supplied-when-a-single/m-p/1218817#M19755</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-13T15:21:54Z</dc:date>
    </item>
  </channel>
</rss>

