<?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: MAXX function throwing another column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MAXX-function-throwing-another-column/m-p/682642#M443</link>
    <description>&lt;P&gt;Weird, I'd try CALENDARAUTO()&lt;/P&gt;</description>
    <pubDate>Thu, 02 May 2019 15:26:44 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2019-05-02T15:26:44Z</dc:date>
    <item>
      <title>MAXX function throwing another column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MAXX-function-throwing-another-column/m-p/682626#M442</link>
      <description>&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Hello PowerBi,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I am trying to return a minimum and maximum date for each user following the sample code listed below.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;=CALENDAR (MINX (Sales, [Date]), MAXX (Forecast, [Date]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;(&lt;A href="https://docs.microsoft.com/en-us/dax/calendar-function-dax" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/dax/calendar-function-dax&lt;/A&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;However, I keep recieving the following error. Why is my MAXX function throwing another column?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Error: The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Code: Test_Column = CALENDAR(MINX('User_Xref', filter('User_Xref', [LastDt] &amp;lt;&amp;gt; blank())), MAXX('User_Xref', filter('User_Xref', [LastDt] &amp;lt;= today())))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 02 May 2019 15:14:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MAXX-function-throwing-another-column/m-p/682626#M442</guid>
      <dc:creator>Unity</dc:creator>
      <dc:date>2019-05-02T15:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: MAXX function throwing another column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MAXX-function-throwing-another-column/m-p/682642#M443</link>
      <description>&lt;P&gt;Weird, I'd try CALENDARAUTO()&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 15:26:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MAXX-function-throwing-another-column/m-p/682642#M443</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2019-05-02T15:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: MAXX function throwing another column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MAXX-function-throwing-another-column/m-p/682644#M444</link>
      <description>&lt;P&gt;Your formula doesn't look too bad, but only as a calculated table which is what CALENDAR is meant for.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I assume both your Sales table and your Forecast table have a [Date] column? First, the best practice is to put the table name before the column name in a formula, so&lt;/P&gt;&lt;P&gt;CALENDAR( MINX(Sales, Sales[Date]), MAXX(Forecast, Forecast[Date]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In fact, this can be written in a simpler way by not using the table functions MINX and MAXX, but the basic aggregations:&lt;/P&gt;&lt;P&gt;CALENDAR(MIN(Sales[Date]), MAX(Forecast[Date]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the last line is the code you're trying to use, the problem there is that MINX expects a scalar value for each row in the table (User_Xref in your case) which is calculated through the expression you provide. This expression is:&lt;/P&gt;&lt;P&gt;FILTER(User_Xref, [LastDT] &amp;lt;&amp;gt; BLANK())&lt;/P&gt;&lt;P&gt;but FILTER returns a subset of the User_Xref table, which probably contains multiple columns. Poor MINX wouldn't know what to compare to what here (even if the table has one column, you would provide multiple rows which wouldn't work either)&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 15:27:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MAXX-function-throwing-another-column/m-p/682644#M444</guid>
      <dc:creator>Michiel</dc:creator>
      <dc:date>2019-05-02T15:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: MAXX function throwing another column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MAXX-function-throwing-another-column/m-p/682668#M445</link>
      <description>&lt;P&gt;Using this code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CALENDAR(MIN(Sales[Date]), MAX(Forecast[Date]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is closer but now results in this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A table of multiple values was supplied where a single value was expected.&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 15:44:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MAXX-function-throwing-another-column/m-p/682668#M445</guid>
      <dc:creator>Unity</dc:creator>
      <dc:date>2019-05-02T15:44:52Z</dc:date>
    </item>
    <item>
      <title>Re: MAXX function throwing another column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MAXX-function-throwing-another-column/m-p/682677#M446</link>
      <description>&lt;P&gt;Tough to say, something wonky with your data? Not actual date fields? I recreated this and had no issues. See attached, Sales, Forecast and Table.&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 15:53:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MAXX-function-throwing-another-column/m-p/682677#M446</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2019-05-02T15:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: MAXX function throwing another column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MAXX-function-throwing-another-column/m-p/682688#M447</link>
      <description>&lt;P&gt;Your code starting with 'Test_Column =' suggests that you're trying to create a calculated column, for which the formula should always return a scalar value. CALENDAR returns a table.&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 16:14:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/MAXX-function-throwing-another-column/m-p/682688#M447</guid>
      <dc:creator>Michiel</dc:creator>
      <dc:date>2019-05-02T16:14:48Z</dc:date>
    </item>
  </channel>
</rss>

