<?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 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/4255923#M168594</link>
    <description>&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;Kindly assist on the below;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&amp;nbsp;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;I am trying to filter one table using the column from another table (date type), however,&amp;nbsp;&lt;SPAN&gt;I get the error&amp;nbsp;&lt;EM&gt;"The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value"&amp;nbsp;&amp;nbsp;when i input the below formula to create a column. How do i solve it?&lt;/EM&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&amp;nbsp;&lt;DIV&gt;&lt;P&gt;FilteredProjects =&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FILTER (&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; gold_procon_projekte_historical,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; gold_procon_projekte_historical[valid_from] &amp;lt;= &lt;SPAN&gt;SELECTEDVALUE(gold_procon_stammdaten[stamm_daten]) &amp;amp;&amp;amp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; (&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gold_procon_projekte_historical[valid_to] &amp;gt;= &lt;SPAN&gt;SELECTEDVALUE(gold_procon_stammdaten[stamm_daten]) ||&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;ISBLANK(gold_procon_projekte_historical[valid_to]) &amp;amp;&amp;amp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gold_procon_projekte_historical[is_current] = &lt;SPAN&gt;TRUE()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; )&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 24 Oct 2024 08:31:45 GMT</pubDate>
    <dc:creator>andicornejo12</dc:creator>
    <dc:date>2024-10-24T08:31:45Z</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/4255923#M168594</link>
      <description>&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;Kindly assist on the below;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&amp;nbsp;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;I am trying to filter one table using the column from another table (date type), however,&amp;nbsp;&lt;SPAN&gt;I get the error&amp;nbsp;&lt;EM&gt;"The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value"&amp;nbsp;&amp;nbsp;when i input the below formula to create a column. How do i solve it?&lt;/EM&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&amp;nbsp;&lt;DIV&gt;&lt;P&gt;FilteredProjects =&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FILTER (&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; gold_procon_projekte_historical,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; gold_procon_projekte_historical[valid_from] &amp;lt;= &lt;SPAN&gt;SELECTEDVALUE(gold_procon_stammdaten[stamm_daten]) &amp;amp;&amp;amp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; (&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gold_procon_projekte_historical[valid_to] &amp;gt;= &lt;SPAN&gt;SELECTEDVALUE(gold_procon_stammdaten[stamm_daten]) ||&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;ISBLANK(gold_procon_projekte_historical[valid_to]) &amp;amp;&amp;amp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gold_procon_projekte_historical[is_current] = &lt;SPAN&gt;TRUE()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; )&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 24 Oct 2024 08:31:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-expression-refers-to-multiple-columns-Multiple-columns/m-p/4255923#M168594</guid>
      <dc:creator>andicornejo12</dc:creator>
      <dc:date>2024-10-24T08:31:45Z</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/4256010#M168596</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="616151" data-lia-user-login="andicornejo12" class="lia-mention lia-mention-user"&gt;andicornejo12&lt;/a&gt;&amp;nbsp;- Try this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;
FILTER (

    ALL(gold_procon_projekte_historical[valid_from], gold_procon_projekte_historical[valid_to], gold_procon_projekte_historical[is_current]),

    gold_procon_projekte_historical[valid_from] &amp;lt;= SELECTEDVALUE(gold_procon_stammdaten[stamm_daten]) &amp;amp;&amp;amp;

    (

        gold_procon_projekte_historical[valid_to] &amp;gt;= SELECTEDVALUE(gold_procon_stammdaten[stamm_daten]) ||

        ISBLANK(gold_procon_projekte_historical[valid_to]) &amp;amp;&amp;amp;

        gold_procon_projekte_historical[is_current] = TRUE()

    )

)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Essentially I'm applying the filters to the specific columns inside the ALL(), rather than the whole table.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this works for you, please accept it as the solution, it will helpwith visibility for others with the same problem.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2024 08:57:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-expression-refers-to-multiple-columns-Multiple-columns/m-p/4256010#M168596</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2024-10-24T08:57:16Z</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/4263985#M168997</link>
      <description>&lt;P&gt;hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="343036" data-lia-user-login="mark_endicott" class="lia-mention lia-mention-user"&gt;mark_endicott&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your answer. Unfortunately I keep getting the same error message:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2024 13:55:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-expression-refers-to-multiple-columns-Multiple-columns/m-p/4263985#M168997</guid>
      <dc:creator>andicornejo12</dc:creator>
      <dc:date>2024-10-30T13:55:22Z</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/4264046#M168999</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="616151" data-lia-user-login="andicornejo12" class="lia-mention lia-mention-user"&gt;andicornejo12&lt;/a&gt;&amp;nbsp;- Are you attempting to use this DAX in a measure? &lt;BR /&gt;&lt;BR /&gt;If so, that's likely to the problem. At the table level, the result for the flag could be both TRUE and FALSE based on the row, and a measure requires a scalar value.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are using a measure, try this:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;VAR _table =
    ADDCOLUMNS (
        gold_procon_projekte_historical,
        "@flag",
            IF (
                gold_procon_projekte_historical[valid_from]
                    &amp;lt;= SELECTEDVALUE ( gold_procon_stammdaten[stamm_daten] )
                    &amp;amp;&amp;amp; (
                        gold_procon_projekte_historical[valid_to]
                            &amp;gt;= SELECTEDVALUE ( gold_procon_stammdaten[stamm_daten] )
                            || ISBLANK ( gold_procon_projekte_historical[valid_to] )
                                &amp;amp;&amp;amp; gold_procon_projekte_historical[is_current] = TRUE ()
                    ),
                1,
                0
            )
    )
RETURN
    MAXX ( _table, [@flag] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It will change your flag to a integer of 1 or 0, but it can now be applied at the row level. I have tested it and it appears to be working fine for me:&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;</description>
      <pubDate>Wed, 30 Oct 2024 14:29:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-expression-refers-to-multiple-columns-Multiple-columns/m-p/4264046#M168999</guid>
      <dc:creator>mark_endicott</dc:creator>
      <dc:date>2024-10-30T14:29:56Z</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/4264288#M169010</link>
      <description>&lt;P&gt;Thanks so much!&lt;/P&gt;&lt;P&gt;Yes it did work for me too &lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2024 16:26:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/The-expression-refers-to-multiple-columns-Multiple-columns/m-p/4264288#M169010</guid>
      <dc:creator>andicornejo12</dc:creator>
      <dc:date>2024-10-30T16:26:15Z</dc:date>
    </item>
  </channel>
</rss>

