<?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 How can I sum the minimum values made with calculate? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-sum-the-minimum-values-made-with-calculate/m-p/2252757#M54321</link>
    <description>&lt;P&gt;Hi, this is my first time asking here, I'm doing this report for my job so any help is well appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a metric with Calculate that sums a formula if the value of a column (numkar) is the maximum for each product (numers 02190,02191,....).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To-CosCom = CALCULATE(&lt;BR /&gt;SUMX(fa_kardex,&lt;BR /&gt;IF(LEFT(fa_kardex[tipkar],1)="C",&lt;BR /&gt;fa_kardex[stkalm]*fa_kardex[stkfra]+fa_kardex[stkalm_m]+fa_kardex[qtypro]*fa_kardex[stkfra]+fa_kardex[qtypro_m],&lt;BR /&gt;fa_kardex[stkalm]*fa_kardex[stkfra]+fa_kardex[stkalm_m]-fa_kardex[qtypro]*fa_kardex[stkfra]-fa_kardex[qtypro_m])&lt;BR /&gt;*fa_kardex[coscom]/fa_kardex[stkfra]),&lt;BR /&gt;fa_kardex[numkar]= MAX(fa_kardex[numkar]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's working well for the products but when I want to sum these values for a category of products (in this case Laboratory, like ABBOT NUTRITIONAL) it gives me the minimum value of all the products from the category, not the sum, which is understandable because of the CALCULATE filter.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to know how can I make that it sums the values and only apply the filter to the products and not to the categories, so I can sum the group.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These are my tables used where many products (fa_productos[codpro]) belong to one laboratory (fa_laboratorios[Laboratorio]) and fa_kardex is the transaction table with many records for each product (thats why I used a filter in the CALCULATE that gives me the maximum transaction code = the latest).&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Dec 2021 13:50:50 GMT</pubDate>
    <dc:creator>RafaelPinto</dc:creator>
    <dc:date>2021-12-23T13:50:50Z</dc:date>
    <item>
      <title>How can I sum the minimum values made with calculate?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-sum-the-minimum-values-made-with-calculate/m-p/2252757#M54321</link>
      <description>&lt;P&gt;Hi, this is my first time asking here, I'm doing this report for my job so any help is well appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a metric with Calculate that sums a formula if the value of a column (numkar) is the maximum for each product (numers 02190,02191,....).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To-CosCom = CALCULATE(&lt;BR /&gt;SUMX(fa_kardex,&lt;BR /&gt;IF(LEFT(fa_kardex[tipkar],1)="C",&lt;BR /&gt;fa_kardex[stkalm]*fa_kardex[stkfra]+fa_kardex[stkalm_m]+fa_kardex[qtypro]*fa_kardex[stkfra]+fa_kardex[qtypro_m],&lt;BR /&gt;fa_kardex[stkalm]*fa_kardex[stkfra]+fa_kardex[stkalm_m]-fa_kardex[qtypro]*fa_kardex[stkfra]-fa_kardex[qtypro_m])&lt;BR /&gt;*fa_kardex[coscom]/fa_kardex[stkfra]),&lt;BR /&gt;fa_kardex[numkar]= MAX(fa_kardex[numkar]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's working well for the products but when I want to sum these values for a category of products (in this case Laboratory, like ABBOT NUTRITIONAL) it gives me the minimum value of all the products from the category, not the sum, which is understandable because of the CALCULATE filter.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to know how can I make that it sums the values and only apply the filter to the products and not to the categories, so I can sum the group.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These are my tables used where many products (fa_productos[codpro]) belong to one laboratory (fa_laboratorios[Laboratorio]) and fa_kardex is the transaction table with many records for each product (thats why I used a filter in the CALCULATE that gives me the maximum transaction code = the latest).&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Dec 2021 13:50:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-sum-the-minimum-values-made-with-calculate/m-p/2252757#M54321</guid>
      <dc:creator>RafaelPinto</dc:creator>
      <dc:date>2021-12-23T13:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: How can I sum the minimum values made with calculate?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-sum-the-minimum-values-made-with-calculate/m-p/2252967#M54331</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="334791" data-lia-user-login="RafaelPinto" class="lia-mention lia-mention-user"&gt;RafaelPinto&lt;/a&gt; , Try like &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sumx(Values(fa_kardex [ABBOT NUTRITIONAL]) ,&lt;/P&gt;
&lt;P&gt;CALCULATE(&lt;BR /&gt;SUMX(fa_kardex,&lt;BR /&gt;IF(LEFT(fa_kardex[tipkar],1)="C",&lt;BR /&gt;fa_kardex[stkalm]*fa_kardex[stkfra]+fa_kardex[stkalm_m]+fa_kardex[qtypro]*fa_kardex[stkfra]+fa_kardex[qtypro_m],&lt;BR /&gt;fa_kardex[stkalm]*fa_kardex[stkfra]+fa_kardex[stkalm_m]-fa_kardex[qtypro]*fa_kardex[stkfra]-fa_kardex[qtypro_m])&lt;BR /&gt;*fa_kardex[coscom]/fa_kardex[stkfra]),&lt;BR /&gt;fa_kardex[numkar]= MAX(fa_kardex[numkar])) ) &lt;/P&gt;</description>
      <pubDate>Thu, 23 Dec 2021 03:20:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-sum-the-minimum-values-made-with-calculate/m-p/2252967#M54331</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-12-23T03:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: How can I sum the minimum values made with calculate?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-sum-the-minimum-values-made-with-calculate/m-p/2253792#M54366</link>
      <description>&lt;P&gt;I tried&amp;nbsp;&lt;BR /&gt;SUMX(VALUES(fa_laboratorios[Laboratorio]),&lt;/P&gt;&lt;P&gt;CALCULATE(&lt;BR /&gt;SUMX(fa_kardex,&lt;BR /&gt;IF(LEFT(fa_kardex[tipkar],1)="C",&lt;BR /&gt;fa_kardex[stkalm]*fa_kardex[stkfra]+fa_kardex[stkalm_m]+fa_kardex[qtypro]*fa_kardex[stkfra]+fa_kardex[qtypro_m],&lt;BR /&gt;fa_kardex[stkalm]*fa_kardex[stkfra]+fa_kardex[stkalm_m]-fa_kardex[qtypro]*fa_kardex[stkfra]-fa_kardex[qtypro_m])*fa_kardex[coscom]/fa_kardex[stkfra]),&lt;BR /&gt;fa_kardex[numkar]= MAX(fa_kardex[numkar])))&amp;nbsp;&lt;BR /&gt;It didn't work, still gives me 0 and not the sum. I didn't specified but in my example Abbot Nutritional is part of the categories of Laboratories (many products belong to one laboratory) and it's related by a table of Products (that connect the product code with the laboratory code) and a table of Laboratories (that connect the laboratory code with the laboratory name). The fact table where I want to apply the individual formula is fa_kardex where there are many registers for each product, thats why I use a filter of the maximum code (numkar) wich is the latest for each product. I want to sum these values by categories but when I do it gives me latest of all the category and not the sum of all the values that belong to that category.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Dec 2021 13:43:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-can-I-sum-the-minimum-values-made-with-calculate/m-p/2253792#M54366</guid>
      <dc:creator>RafaelPinto</dc:creator>
      <dc:date>2021-12-23T13:43:30Z</dc:date>
    </item>
  </channel>
</rss>

