<?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 Max sequence number filtered in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Max-sequence-number-filtered/m-p/823706#M5710</link>
    <description>&lt;P&gt;The data I am working has a parent sequence number and a child sequence number.&amp;nbsp; I want to be able to return the max sequence number filtered on a date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried many diffent ways to accomplish this with no success.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been able to count the child sequence number with a filter on the parent sequence number and the date):&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Test = calculate(counta('TABLE'[CHILD_SEQ]),FILTER(ALL('TABLE'),'TABLE'[PARENT_SEQ]=EARLIER('TABLE'[PARENT_SEQ]) &amp;amp;&amp;amp; 'TABLE'[CHILD_SEQ_DATE]=EARLIER('TABLE'[CHILD_SEQ_DATE])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This returns a count of child sequence number that are on the same date.&amp;nbsp;&amp;nbsp; I now want to return the maximum child sequence number on the row that has the maximum child sequence number and nothing for any row that is not a maximum, based on the filter above.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Everytime I try to use an if statement i get: &lt;STRONG&gt;The expression refers to multiple columns&lt;/STRONG&gt;. &lt;STRONG&gt;Multiple columns cannot be converted&lt;/STRONG&gt; to a &lt;STRONG&gt;scalar value&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;STRONG&gt;Thanks!&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;STRONG&gt;RJ&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 21 Oct 2019 18:02:31 GMT</pubDate>
    <dc:creator>rjs2</dc:creator>
    <dc:date>2019-10-21T18:02:31Z</dc:date>
    <item>
      <title>Max sequence number filtered</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Max-sequence-number-filtered/m-p/823706#M5710</link>
      <description>&lt;P&gt;The data I am working has a parent sequence number and a child sequence number.&amp;nbsp; I want to be able to return the max sequence number filtered on a date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried many diffent ways to accomplish this with no success.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been able to count the child sequence number with a filter on the parent sequence number and the date):&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Test = calculate(counta('TABLE'[CHILD_SEQ]),FILTER(ALL('TABLE'),'TABLE'[PARENT_SEQ]=EARLIER('TABLE'[PARENT_SEQ]) &amp;amp;&amp;amp; 'TABLE'[CHILD_SEQ_DATE]=EARLIER('TABLE'[CHILD_SEQ_DATE])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This returns a count of child sequence number that are on the same date.&amp;nbsp;&amp;nbsp; I now want to return the maximum child sequence number on the row that has the maximum child sequence number and nothing for any row that is not a maximum, based on the filter above.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Everytime I try to use an if statement i get: &lt;STRONG&gt;The expression refers to multiple columns&lt;/STRONG&gt;. &lt;STRONG&gt;Multiple columns cannot be converted&lt;/STRONG&gt; to a &lt;STRONG&gt;scalar value&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;STRONG&gt;Thanks!&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;STRONG&gt;RJ&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 21 Oct 2019 18:02:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Max-sequence-number-filtered/m-p/823706#M5710</guid>
      <dc:creator>rjs2</dc:creator>
      <dc:date>2019-10-21T18:02:31Z</dc:date>
    </item>
    <item>
      <title>Re: Max sequence number filtered</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Max-sequence-number-filtered/m-p/823742#M5712</link>
      <description>&lt;P&gt;I tried this as well:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Test2 = VAR SEQ= CALCULATE(MAX('Vetting Query'[CHILD_SEQ]),ALL('TABLE'),'TABLE'[PARENT_SEQ]=EARLIER('TABLE'[PARENT_SEQ]) &amp;amp;&amp;amp; 'TABLE'[CHILD_SEQ_DATE]=EARLIER('TABLE'[CHILD_SEQ_DATE]))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Return&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SEQ&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the error I get:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;The expression contains multiple columns, but only a single column can be used in a True/False expression that is used as a table filter expression.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2019 18:36:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Max-sequence-number-filtered/m-p/823742#M5712</guid>
      <dc:creator>rjs2</dc:creator>
      <dc:date>2019-10-21T18:36:26Z</dc:date>
    </item>
    <item>
      <title>Re: Max sequence number filtered</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Max-sequence-number-filtered/m-p/823832#M5714</link>
      <description>&lt;P&gt;Took some time, but I solved it.&amp;nbsp; It was easier to stop into it with two columns&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First new column:&lt;/P&gt;&lt;P&gt;Max on Day = CALCULATE(MAX('Vetting Query'[CHILD_SEQ]),ALL('TABLE'),'TABLE'[PARENT_SEQ]=EARLIER('TABLE'[PARENT_SEQ]) &amp;amp;&amp;amp; 'TABLE'[CHILD_SEQ_DATE]=EARLIER('TABLE'[CHILD_SEQ_DATE]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This gave me the max sequence number for the child sequence per day on every row related to that parrent seq.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Second new column:&lt;/P&gt;&lt;P&gt;Number Processed &lt;SPAN&gt;= if('TABLE[Max on Day]='TABLE[CHILD_SEQ],'Vetting Query'[CHILD_SEQ],"")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Number Processed will only have the Max CHILD_SEQ on the row of the Max sequence number and a blank if its not the max sequence number.&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 21 Oct 2019 20:01:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Max-sequence-number-filtered/m-p/823832#M5714</guid>
      <dc:creator>rjs2</dc:creator>
      <dc:date>2019-10-21T20:01:23Z</dc:date>
    </item>
  </channel>
</rss>

