<?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: Calculate: A table of multiple values was supplied where a single value was expected. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-A-table-of-multiple-values-was-supplied-where-a-single/m-p/2252360#M54271</link>
    <description>&lt;P&gt;Hi, thanks for your response! How do i implemented this in the dax formula?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Dec 2021 16:08:03 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-12-22T16:08:03Z</dc:date>
    <item>
      <title>Calculate: A table of multiple values was supplied where a single value was expected.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-A-table-of-multiple-values-was-supplied-where-a-single/m-p/2252163#M54257</link>
      <description>&lt;P&gt;Hi guys,&lt;BR /&gt;&lt;BR /&gt;Last year my collegue wrote a dax formula for my BI report.&amp;nbsp;Unfortunately he is no longer working at my firm. Couple of days ago the datasource of my report was moved into the cloud. I already changed the location of the datasource in my report, but the Dax formula he wrote for me doesn't work since then. I tried a couple of things but it wouldn't work. The error is:&amp;nbsp;A table of multiple values was supplied where a single value was expected. Can someone help me? Thank you!&lt;BR /&gt;&lt;BR /&gt;The dax formula:&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;EmployeeKey = &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;DISTINCT('DimEmployee'[EmployeeKey]), &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER('DimEmployee',&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;'FactActualHoursAll'[TT_EMP_ID] = 'DimEmployee'[EmployeeId] &amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;'FactActualHoursAll'[TT_date] &amp;gt;= 'DimEmployee'[RowEffectiveDate] &amp;amp;&amp;amp; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;'FactActualHoursAll'[TT_date] &amp;lt;= 'DimEmployee'[RowExpirationDate]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;/SPAN&gt;)&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 14:31:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-A-table-of-multiple-values-was-supplied-where-a-single/m-p/2252163#M54257</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-22T14:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate: A table of multiple values was supplied where a single value was expected.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-A-table-of-multiple-values-was-supplied-where-a-single/m-p/2252320#M54266</link>
      <description>&lt;P&gt;Test it by replacing DISTINCT with DISTINCTCOUNT.&amp;nbsp; If you get results of greater than 1, that's the problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 15:37:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-A-table-of-multiple-values-was-supplied-where-a-single/m-p/2252320#M54266</guid>
      <dc:creator>HotChilli</dc:creator>
      <dc:date>2021-12-22T15:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate: A table of multiple values was supplied where a single value was expected.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-A-table-of-multiple-values-was-supplied-where-a-single/m-p/2252324#M54267</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It looks like you're trying to add a calculated column onto your fact table from a slowly changing dimension, DimEmployee.&lt;/P&gt;
&lt;P&gt;The issue is DISTINCT returns a table, and tables can't be embedded in another table.&lt;/P&gt;
&lt;P&gt;You should be using a function that returns a scalar.&amp;nbsp; You could have MAX, MIN, or perhaps SELECTEDVALUE, with a default for when there's more than one row in DimEmployee that meets the filter condition.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 15:40:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-A-table-of-multiple-values-was-supplied-where-a-single/m-p/2252324#M54267</guid>
      <dc:creator>PaulOlding</dc:creator>
      <dc:date>2021-12-22T15:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate: A table of multiple values was supplied where a single value was expected.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-A-table-of-multiple-values-was-supplied-where-a-single/m-p/2252359#M54270</link>
      <description>&lt;P&gt;Hi, I did it. I get 10 rows of number 2 and that's it. How do i fix this?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 16:07:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-A-table-of-multiple-values-was-supplied-where-a-single/m-p/2252359#M54270</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-22T16:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate: A table of multiple values was supplied where a single value was expected.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-A-table-of-multiple-values-was-supplied-where-a-single/m-p/2252360#M54271</link>
      <description>&lt;P&gt;Hi, thanks for your response! How do i implemented this in the dax formula?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 16:08:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-A-table-of-multiple-values-was-supplied-where-a-single/m-p/2252360#M54271</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-22T16:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate: A table of multiple values was supplied where a single value was expected.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-A-table-of-multiple-values-was-supplied-where-a-single/m-p/2252384#M54274</link>
      <description>&lt;P&gt;So you have multiple rows in DimEmployee that meet this condition&lt;/P&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;'FactActualHoursAll'[TT_EMP_ID] = 'DimEmployee'[EmployeeId] &amp;amp;&amp;amp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;'FactActualHoursAll'[TT_date] &amp;gt;= 'DimEmployee'[RowEffectiveDate] &amp;amp;&amp;amp;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;'FactActualHoursAll'[TT_date] &amp;lt;= 'DimEmployee'[RowExpirationDate]&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;I would try to find out why.&amp;nbsp; Choose a row of the fact table from your screenshot and see which rows are matching in DimEmployee.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt;You mentioned the datasource has moved.&amp;nbsp; Just throwing out ideas but, as your condition includes dates, perhaps there's something different about the date formats in the new datasource?&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 22 Dec 2021 16:21:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-A-table-of-multiple-values-was-supplied-where-a-single/m-p/2252384#M54274</guid>
      <dc:creator>PaulOlding</dc:creator>
      <dc:date>2021-12-22T16:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate: A table of multiple values was supplied where a single value was expected.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-A-table-of-multiple-values-was-supplied-where-a-single/m-p/2252789#M54327</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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can you post sample data as text and expected output?&lt;BR /&gt;&lt;BR /&gt;please see this post regarding How to Get Your Question Answered Quickly:&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN&gt;The most important parts are:&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;1. Sample data as &lt;STRONG&gt;text&lt;/STRONG&gt;, use the table tool in the editing bar&lt;BR /&gt;2.&lt;STRONG&gt; Expected output from sample data&lt;/STRONG&gt;&lt;BR /&gt;3. Explanation in words of how to get from 1. to 2.&lt;BR /&gt;4. &lt;STRONG&gt;Relation&lt;/STRONG&gt; between your tables&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN&gt;Appreciate your Kudos!!&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN&gt;LinkedIn:&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;A href="https://www.linkedin.com/in/vahid-dm/" target="_blank"&gt;www.linkedin.com/in/vahid-dm/&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Dec 2021 23:48:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-A-table-of-multiple-values-was-supplied-where-a-single/m-p/2252789#M54327</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2021-12-22T23:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate: A table of multiple values was supplied where a single value was expected.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-A-table-of-multiple-values-was-supplied-where-a-single/m-p/2257491#M54520</link>
      <description>&lt;P&gt;Hi&amp;nbsp; Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You can try to add all() or allselect() to the function&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;EmployeeKey =
CALCULATE (
    DISTINCT ( 'DimEmployee'[EmployeeKey] ),
    FILTER (
        ALLSELECTED ( 'DimEmployee' ),
        'FactActualHoursAll'[TT_EMP_ID] = 'DimEmployee'[EmployeeId]
            &amp;amp;&amp;amp; 'FactActualHoursAll'[TT_date] &amp;gt;= 'DimEmployee'[RowEffectiveDate]
            &amp;amp;&amp;amp; 'FactActualHoursAll'[TT_date] &amp;lt;= 'DimEmployee'[RowExpirationDate]
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Dec 2021 01:21:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculate-A-table-of-multiple-values-was-supplied-where-a-single/m-p/2257491#M54520</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-28T01:21:31Z</dc:date>
    </item>
  </channel>
</rss>

