<?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 expression refers to multiple columns. Multiple columns cannot be converted to a scalar value. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-expression-refers-to-multiple-columns-Multiple-columns/m-p/4688722#M179566</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="859703" data-lia-user-login="proavinash" class="lia-mention lia-mention-user"&gt;proavinash&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you for reaching out to the Microsoft Fabric Forum Community.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;I&gt;&lt;/I&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;The UNION function returns a table as a result, so rather than creating a measure, try creating a calculated table.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Please refer the below Document:&lt;BR /&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/union-function-dax" target="_blank" rel="noopener"&gt;UNION function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;helps, then please give us ‘Kudos’ and consider&amp;nbsp;Accept it as a solution&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 12 May 2025 08:54:50 GMT</pubDate>
    <dc:creator>v-saisrao-msft</dc:creator>
    <dc:date>2025-05-12T08:54:50Z</dc:date>
    <item>
      <title>The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-expression-refers-to-multiple-columns-Multiple-columns/m-p/4687254#M179514</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;please suggest a solution.&lt;/P&gt;</description>
      <pubDate>Sat, 10 May 2025 06:36:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-expression-refers-to-multiple-columns-Multiple-columns/m-p/4687254#M179514</guid>
      <dc:creator>proavinash</dc:creator>
      <dc:date>2025-05-10T06:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-expression-refers-to-multiple-columns-Multiple-columns/m-p/4687504#M179519</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="859703" data-lia-user-login="proavinash" class="lia-mention lia-mention-user"&gt;proavinash&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The error occurs because UNION() only accepts two tables at a time, but you're passing in three ADDCOLUMNS() results directly. DAX cannot interpret more than two tables unless you nest the UNION() calls. To fix it, you need to combine the second and third ADDCOLUMNS() calls using UNION() first, then combine that result with the first one. Here's the corrected version of your DAX:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;MTD/QTD/YTD =
var TodayDate = TODAY()
var startyear = CALCULATE(STARTOFYEAR(SaleDump[Date].[Date]), YEAR(SaleDump[Date]) = YEAR(TodayDate))
var startquarter = CALCULATE(STARTOFQUARTER(SaleDump[Date].[Date]), YEAR(SaleDump[Date]) = YEAR(TodayDate), QUARTER(SaleDump[Date]) = QUARTER(TodayDate))
var startmonth = CALCULATE(STARTOFMONTH(SaleDump[Date].[Date]), YEAR(SaleDump[Date]) = YEAR(TodayDate), MONTH(SaleDump[Date]) = MONTH(TodayDate))
var result =
    UNION(
        ADDCOLUMNS(CALENDAR(startyear, TodayDate), "Selection", "YTD"),
        UNION(
            ADDCOLUMNS(CALENDAR(startquarter, TodayDate), "Selection", "QTD"),
            ADDCOLUMNS(CALENDAR(startmonth, TodayDate), "Selection", "MTD")
        )
    )
RETURN
    result
&lt;/LI-CODE&gt;
&lt;P&gt;This corrects the structure so each UNION() has exactly two inputs and avoids the scalar value conversion error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;</description>
      <pubDate>Sat, 10 May 2025 14:04:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-expression-refers-to-multiple-columns-Multiple-columns/m-p/4687504#M179519</guid>
      <dc:creator>DataNinja777</dc:creator>
      <dc:date>2025-05-10T14:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-expression-refers-to-multiple-columns-Multiple-columns/m-p/4687788#M179527</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;SAME ERROR AGAIN.&lt;/P&gt;</description>
      <pubDate>Sun, 11 May 2025 09:05:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-expression-refers-to-multiple-columns-Multiple-columns/m-p/4687788#M179527</guid>
      <dc:creator>proavinash</dc:creator>
      <dc:date>2025-05-11T09:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-expression-refers-to-multiple-columns-Multiple-columns/m-p/4688722#M179566</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="859703" data-lia-user-login="proavinash" class="lia-mention lia-mention-user"&gt;proavinash&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you for reaching out to the Microsoft Fabric Forum Community.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;I&gt;&lt;/I&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;The UNION function returns a table as a result, so rather than creating a measure, try creating a calculated table.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Please refer the below Document:&lt;BR /&gt;&lt;A href="https://learn.microsoft.com/en-us/dax/union-function-dax" target="_blank" rel="noopener"&gt;UNION function (DAX) - DAX | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;helps, then please give us ‘Kudos’ and consider&amp;nbsp;Accept it as a solution&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 12 May 2025 08:54:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-expression-refers-to-multiple-columns-Multiple-columns/m-p/4688722#M179566</guid>
      <dc:creator>v-saisrao-msft</dc:creator>
      <dc:date>2025-05-12T08:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-expression-refers-to-multiple-columns-Multiple-columns/m-p/4693236#M179717</link>
      <description>&lt;P&gt;&lt;SPAN data-teams="true"&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="859703" data-lia-user-login="proavinash" class="lia-mention lia-mention-user"&gt;proavinash&lt;/a&gt;,&lt;BR /&gt;I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please &lt;STRONG&gt;Accept it as a solution&lt;/STRONG&gt; and give it a '&lt;STRONG&gt;Kudos&lt;/STRONG&gt;' so others can find it easily.&lt;BR /&gt;Thank you.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 May 2025 03:29:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-expression-refers-to-multiple-columns-Multiple-columns/m-p/4693236#M179717</guid>
      <dc:creator>v-saisrao-msft</dc:creator>
      <dc:date>2025-05-15T03:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-expression-refers-to-multiple-columns-Multiple-columns/m-p/4697591#M179921</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="859703" data-lia-user-login="proavinash" class="lia-mention lia-mention-user"&gt;proavinash&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 19 May 2025 04:37:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-expression-refers-to-multiple-columns-Multiple-columns/m-p/4697591#M179921</guid>
      <dc:creator>v-saisrao-msft</dc:creator>
      <dc:date>2025-05-19T04:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-expression-refers-to-multiple-columns-Multiple-columns/m-p/4702878#M180123</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="859703" data-lia-user-login="proavinash" class="lia-mention lia-mention-user"&gt;proavinash&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We haven’t heard back from you regarding your issue. If it has been resolved, please mark the helpful response as the solution and give a ‘Kudos’ to assist others. If you still need support, let us know.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 May 2025 06:41:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-expression-refers-to-multiple-columns-Multiple-columns/m-p/4702878#M180123</guid>
      <dc:creator>v-saisrao-msft</dc:creator>
      <dc:date>2025-05-22T06:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-expression-refers-to-multiple-columns-Multiple-columns/m-p/4707799#M180301</link>
      <description>&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;not working same error&lt;/P&gt;</description>
      <pubDate>Mon, 26 May 2025 15:04:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-expression-refers-to-multiple-columns-Multiple-columns/m-p/4707799#M180301</guid>
      <dc:creator>proavinash</dc:creator>
      <dc:date>2025-05-26T15:04:20Z</dc:date>
    </item>
  </channel>
</rss>

