<?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: Sum of Max at row level in a measure with filters in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-Max-at-row-level-in-a-measure-with-filters/m-p/3574511#M137811</link>
    <description>&lt;P&gt;I tried this logic to filter but this doesn't work because the first argument of filter function is to provide the table name and in this case we are not providing a table for Product column.&lt;/P&gt;</description>
    <pubDate>Fri, 08 Dec 2023 13:44:13 GMT</pubDate>
    <dc:creator>Pdawar</dc:creator>
    <dc:date>2023-12-08T13:44:13Z</dc:date>
    <item>
      <title>Sum of Max at row level in a measure with filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-Max-at-row-level-in-a-measure-with-filters/m-p/3574200#M137786</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to be able to create a calculation at row level in a measure without adding a calculated column. In my Patient data, I want to calculate the sum of patients for each month but before calculating sum, I want to apply a condition at row level which is Max(Patients, 0).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am able to achieve this using the following measure -&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;test - Max &lt;/SPAN&gt;&lt;SPAN&gt;at&lt;/SPAN&gt;&lt;SPAN&gt; row level =&lt;/SPAN&gt; &lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUMX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Patients&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Patients&lt;/SPAN&gt;&lt;SPAN&gt;[Patients]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;)))&lt;/SPAN&gt;&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;SPAN&gt;But I want to able to apply filters like Type = "Paid" and Product = "Product A" and I am not sure how to that in the above mesure so that it keeps the calculation intact.&lt;/SPAN&gt;&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;SPAN&gt;Please let me know if you have any solutions. The client is not keen on adding a column in the data and wants to calculate everything in a measure.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 08 Dec 2023 09:52:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-Max-at-row-level-in-a-measure-with-filters/m-p/3574200#M137786</guid>
      <dc:creator>Pdawar</dc:creator>
      <dc:date>2023-12-08T09:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Max at row level in a measure with filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-Max-at-row-level-in-a-measure-with-filters/m-p/3574312#M137795</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="533242" data-lia-user-login="Pdawar" class="lia-mention lia-mention-user"&gt;Pdawar&lt;/a&gt;&amp;nbsp; You can apply those filter inside FILTER DAX Fuction and then apply the SUMX on that filtered table. You can try the below formula.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Max&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;at&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;row level&amp;nbsp; =&amp;nbsp;&lt;BR /&gt;var _filteredPatientstable = FILTER(Patients,Patients[TYPE]="Paid" &amp;amp;&amp;amp; Patients[Product]="Product A")&lt;BR /&gt;return&amp;nbsp;&lt;BR /&gt;SUMX(_filteredPatientstable,&amp;nbsp;MAX(Patients[Patients] )&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2023 11:27:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-Max-at-row-level-in-a-measure-with-filters/m-p/3574312#M137795</guid>
      <dc:creator>saurabhtd</dc:creator>
      <dc:date>2023-12-08T11:27:43Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Max at row level in a measure with filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-Max-at-row-level-in-a-measure-with-filters/m-p/3574333#M137797</link>
      <description>&lt;P&gt;Thank you! And can filter from another table can also be applied? So the data model is star schema and the product filter needs to be applied from the Product table.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2023 11:55:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-Max-at-row-level-in-a-measure-with-filters/m-p/3574333#M137797</guid>
      <dc:creator>Pdawar</dc:creator>
      <dc:date>2023-12-08T11:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Max at row level in a measure with filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-Max-at-row-level-in-a-measure-with-filters/m-p/3574481#M137808</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="533242" data-lia-user-login="Pdawar" class="lia-mention lia-mention-user"&gt;Pdawar&lt;/a&gt;&amp;nbsp;If the data model is star schema then you can apply the filter condition in FILER DAX function from Product dimension. But there needs to be relationship between fact and dimesion.&amp;nbsp;&lt;BR /&gt;for example :&amp;nbsp;&lt;BR /&gt;&lt;SPAN&gt;Max&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;at&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;row level&amp;nbsp; =&amp;nbsp;&lt;BR /&gt;var _filteredPatientstable = FILTER(Patients,Patients[TYPE]="Paid" &amp;amp;&amp;amp; product[Product]="Product A")&lt;BR /&gt;return&amp;nbsp;&lt;BR /&gt;SUMX(_filteredPatientstable,&amp;nbsp;MAX(Patients[Patients] )&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2023 13:22:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-Max-at-row-level-in-a-measure-with-filters/m-p/3574481#M137808</guid>
      <dc:creator>saurabhtd</dc:creator>
      <dc:date>2023-12-08T13:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Max at row level in a measure with filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-Max-at-row-level-in-a-measure-with-filters/m-p/3574511#M137811</link>
      <description>&lt;P&gt;I tried this logic to filter but this doesn't work because the first argument of filter function is to provide the table name and in this case we are not providing a table for Product column.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2023 13:44:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-Max-at-row-level-in-a-measure-with-filters/m-p/3574511#M137811</guid>
      <dc:creator>Pdawar</dc:creator>
      <dc:date>2023-12-08T13:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Max at row level in a measure with filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-Max-at-row-level-in-a-measure-with-filters/m-p/3574723#M137825</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="533242" data-lia-user-login="Pdawar" class="lia-mention lia-mention-user"&gt;Pdawar&lt;/a&gt;&amp;nbsp;Sorry yes that will not work.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;For having that flexibility to use filter from dimension row wise. You can try using CALCULATETABLE DAX function.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Max&amp;nbsp;at&amp;nbsp;row level&amp;nbsp; =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;_filteredPatientstable&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;= &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATETABLE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Patients &lt;/SPAN&gt;&lt;SPAN&gt;,Patients&lt;/SPAN&gt;&lt;SPAN&gt;[TYPE]&lt;/SPAN&gt;&lt;SPAN&gt; = "Paid"&lt;/SPAN&gt;&lt;SPAN&gt;, product[Product]="Product A"&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;SPAN&gt; SUMX(_filteredPatientstable,&amp;nbsp;MAX(Patients[Patients] )&lt;BR /&gt;&lt;BR /&gt;I think this can work for your use case.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2023 15:47:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-Max-at-row-level-in-a-measure-with-filters/m-p/3574723#M137825</guid>
      <dc:creator>saurabhtd</dc:creator>
      <dc:date>2023-12-08T15:47:55Z</dc:date>
    </item>
    <item>
      <title>Re: Sum of Max at row level in a measure with filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-Max-at-row-level-in-a-measure-with-filters/m-p/3576870#M137924</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="478644" data-lia-user-login="saurabhtd" class="lia-mention lia-mention-user"&gt;saurabhtd&lt;/a&gt;&amp;nbsp;thank you! Yes this works.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2023 06:06:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Sum-of-Max-at-row-level-in-a-measure-with-filters/m-p/3576870#M137924</guid>
      <dc:creator>Pdawar</dc:creator>
      <dc:date>2023-12-11T06:06:38Z</dc:date>
    </item>
  </channel>
</rss>

