<?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: PowerPivot measures: calculate a &amp;quot;SUMIFS&amp;quot; function, connecting 3 tables and 2 different fields in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerPivot-measures-calculate-a-quot-SUMIFS-quot-function/m-p/2408381#M63319</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="369540" data-lia-user-login="fedefabio" class="lia-mention lia-mention-user"&gt;fedefabio&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;THe TESTNAME column in the visual from which table? Can you also share a sreeshot of your data model? Thak you and have a great day!&lt;/P&gt;</description>
    <pubDate>Tue, 22 Mar 2022 06:01:14 GMT</pubDate>
    <dc:creator>tamerj1</dc:creator>
    <dc:date>2022-03-22T06:01:14Z</dc:date>
    <item>
      <title>PowerPivot measures: calculate a "SUMIFS" function, connecting 3 tables and 2 different fields</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerPivot-measures-calculate-a-quot-SUMIFS-quot-function/m-p/2408208#M63313</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have this kind of problems.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for an Inventory management tool I am creating I have 3 different tables:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. StockIN: all the entry records, main fields:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Serial_nr_IN&lt;/LI&gt;&lt;LI&gt;Product_name_IN&lt;/LI&gt;&lt;LI&gt;WH_Categ_Lvl1_IN&lt;UL&gt;&lt;LI&gt;WH_Categ_Lvl2_IN&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Qty_IN&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;2. StockOUT: all the out records&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Serial_nr_OUT&lt;/LI&gt;&lt;LI&gt;Product_name_OUT&lt;/LI&gt;&lt;LI&gt;WH_Categ_Lvl1_OUT&lt;UL&gt;&lt;LI&gt;WH_Categ_Lvl2_OUT&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Qty_OUT&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and then the table 'int_mov' that allows to change WH_cateogories, so related fields are:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Serial_nr_mov&lt;/LI&gt;&lt;LI&gt;Product_name_mov&lt;/LI&gt;&lt;LI&gt;FROM_WH_Categ_Lvl1&lt;UL&gt;&lt;LI&gt;FROM WH_Categ_Lvl2&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;TO_WH_Categ_Lvl1&lt;/LI&gt;&lt;LI&gt;TO WH_Categ_Lvl2&lt;/LI&gt;&lt;LI&gt;Qty_mov&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;*****&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created relationships between&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;stock out and stock in by serial nr&lt;/LI&gt;&lt;LI&gt;int_mov and stock in by serial nr.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;then I've created the power pivot table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am struggling with to create the calculated measure that basically allows me to calculate the actual net quantity &lt;STRONG&gt;per Wh_Category_lvl1(so far...)&lt;/STRONG&gt;. the concept is this one:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CURRENT QTY: qty_IN - Qty_OUT - Qty_mov[FROM] + Qty_mov[TO]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so I've created this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(StockIN_entry[Quantity_Units_IN])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(StockOUT_entry[Quantity_Units_OUT])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(internal_mov_entry[Quantity_Units_mov]),&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(internal_mov_entry,internal_mov_entry[FROM WH_Name_Lv1]=&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;(StockIN_entry[WH_Name_Lv1_IN]))))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;+&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(internal_mov_entry[Quantity_Units_mov]),&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(internal_mov_entry,internal_mov_entry[TO WH_Name_Lv1]=&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;(StockIN_entry[WH_Name_Lv1_IN]))))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but seems it cannot work properly with the last argument:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;CALCULATE(SUM(internal_mov_entry[Quantity_Units_mov]),FILTER(internal_mov_entry,internal_mov_entry[TO WH_Name_Lv1]=CALCULATE(VALUES(StockIN_entry[WH_Name_Lv1_IN]))))&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and finally, what if I want to add WH_cat_Lvl2?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2022 04:37:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerPivot-measures-calculate-a-quot-SUMIFS-quot-function/m-p/2408208#M63313</guid>
      <dc:creator>fedefabio</dc:creator>
      <dc:date>2022-03-22T04:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: PowerPivot measures: calculate a "SUMIFS" function, connecting 3 tables and 2 different fields</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerPivot-measures-calculate-a-quot-SUMIFS-quot-function/m-p/2408244#M63315</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="369540" data-lia-user-login="fedefabio" class="lia-mention lia-mention-user"&gt;fedefabio&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;how does your repor look like? Can you a screenshot?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2022 04:57:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerPivot-measures-calculate-a-quot-SUMIFS-quot-function/m-p/2408244#M63315</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-03-22T04:57:54Z</dc:date>
    </item>
    <item>
      <title>Re: PowerPivot measures: calculate a "SUMIFS" function, connecting 3 tables and 2 different fields</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerPivot-measures-calculate-a-quot-SUMIFS-quot-function/m-p/2408322#M63317</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sure &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&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;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&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;&lt;P&gt;cheers!&lt;/P&gt;&lt;P&gt;F&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2022 05:47:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerPivot-measures-calculate-a-quot-SUMIFS-quot-function/m-p/2408322#M63317</guid>
      <dc:creator>fedefabio</dc:creator>
      <dc:date>2022-03-22T05:47:38Z</dc:date>
    </item>
    <item>
      <title>Re: PowerPivot measures: calculate a "SUMIFS" function, connecting 3 tables and 2 different fields</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerPivot-measures-calculate-a-quot-SUMIFS-quot-function/m-p/2408381#M63319</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="369540" data-lia-user-login="fedefabio" class="lia-mention lia-mention-user"&gt;fedefabio&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;THe TESTNAME column in the visual from which table? Can you also share a sreeshot of your data model? Thak you and have a great day!&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2022 06:01:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerPivot-measures-calculate-a-quot-SUMIFS-quot-function/m-p/2408381#M63319</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-03-22T06:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: PowerPivot measures: calculate a "SUMIFS" function, connecting 3 tables and 2 different fields</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerPivot-measures-calculate-a-quot-SUMIFS-quot-function/m-p/2408443#M63324</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;from Stock_IN&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sure!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is StockIN_entry table&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;this is from Stock_out&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;and this below from int_mov&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks to you and have a great day too! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2022 06:22:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerPivot-measures-calculate-a-quot-SUMIFS-quot-function/m-p/2408443#M63324</guid>
      <dc:creator>fedefabio</dc:creator>
      <dc:date>2022-03-22T06:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: PowerPivot measures: calculate a "SUMIFS" function, connecting 3 tables and 2 different fields</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerPivot-measures-calculate-a-quot-SUMIFS-quot-function/m-p/2408994#M63352</link>
      <description>&lt;P&gt;Sorry&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="369540" data-lia-user-login="fedefabio" class="lia-mention lia-mention-user"&gt;fedefabio&lt;/a&gt;&amp;nbsp;for the late reply. I got distracted with some other stuff.&lt;/P&gt;&lt;P&gt;Actually I was asking about the data model (relationships). However from the sample data you've shared I can guess they're all one-one relationships. Yet, I cannot the see the reason behind manually filtering the sum from the&amp;nbsp;&lt;SPAN&gt;'int_mov' table. You can simply go for&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;Difference =
SUM ( StockIN_entry[Quantity_Units_IN] )
    - SUM ( StockOUT_entry[Quantity_Units_OUT] )
    - SUM ( internal_mov_entry[Quantity_Units_mov] )
    + SUM ( internal_mov_entry[Quantity_Units_mov] )&lt;/LI-CODE&gt;&lt;P&gt;Unless the actual relationships are not as I expected them to be.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2022 09:36:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerPivot-measures-calculate-a-quot-SUMIFS-quot-function/m-p/2408994#M63352</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-03-22T09:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: PowerPivot measures: calculate a "SUMIFS" function, connecting 3 tables and 2 different fields</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerPivot-measures-calculate-a-quot-SUMIFS-quot-function/m-p/2409641#M63415</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;, no worries at all and thanks again for your time!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By the way, the formula you wrote was the first one I've tried but it was not working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Relationships are many-to-one as below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I am afraid that the issue stands in the 'int_mov' table where there are 2 different columns with "Wh_lvl1" (FROM and TO)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers!&lt;BR /&gt;F&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2022 13:43:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerPivot-measures-calculate-a-quot-SUMIFS-quot-function/m-p/2409641#M63415</guid>
      <dc:creator>fedefabio</dc:creator>
      <dc:date>2022-03-22T13:43:20Z</dc:date>
    </item>
    <item>
      <title>Re: PowerPivot measures: calculate a "SUMIFS" function, connecting 3 tables and 2 different fields</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerPivot-measures-calculate-a-quot-SUMIFS-quot-function/m-p/2409789#M63428</link>
      <description>&lt;P&gt;Excellent now all clear. Can you please write the names three columns involved in the relationships?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2022 14:22:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerPivot-measures-calculate-a-quot-SUMIFS-quot-function/m-p/2409789#M63428</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-03-22T14:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: PowerPivot measures: calculate a "SUMIFS" function, connecting 3 tables and 2 different fields</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerPivot-measures-calculate-a-quot-SUMIFS-quot-function/m-p/2411003#M63507</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;, sure!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in the pivot table we have&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;row: &lt;STRONG&gt;StockIN_entry[Product_Name_IN]&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;column(s): &lt;STRONG&gt;StockIN_entry[WH_Name_Lv1_IN]&lt;/STRONG&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;EM&gt;(in future will add Lv2)&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for calculation values, columns involves are:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;&lt;SPAN&gt;StockIN_entry[Quantity_Units_IN]&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;&lt;SPAN&gt;StockOUT_entry[Quantity_Units_OUT]&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;and for internal movment table, we have:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;&lt;SPAN&gt;internal_mov_entry[Quantity_Units_mov]&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;with&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;&lt;SPAN&gt;internal_mov_entry[FROM WH_Name_Lv1]&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;internal_mov_entry[TO WH_Name_Lv1]&lt;/STRONG&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope everything is clear &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;cheers!&lt;/P&gt;&lt;P&gt;F&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 03:00:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerPivot-measures-calculate-a-quot-SUMIFS-quot-function/m-p/2411003#M63507</guid>
      <dc:creator>fedefabio</dc:creator>
      <dc:date>2022-03-23T03:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: PowerPivot measures: calculate a "SUMIFS" function, connecting 3 tables and 2 different fields</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerPivot-measures-calculate-a-quot-SUMIFS-quot-function/m-p/2411162#M63524</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="369540" data-lia-user-login="fedefabio" class="lia-mention lia-mention-user"&gt;fedefabio&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Yes everything is clear now. I will try to explain the best I can. What you want to do can be achieved completely using DAX code but you will spend hard time trying to achieve that and the result code will be neither efficient&amp;nbsp;nor readable. The reason is your report uses columns from the fact table and these columns cannot filter other tables automatically hence you need to write extra DAX code every step&amp;nbsp;onwards. For example for the '&lt;SPAN&gt;StockOUT' table you cannot just SUM the quantity&amp;nbsp;column as it won't be filtered by the 'StockIN[&lt;/SPAN&gt;Product_name_IN] cannot filter the 'StockOUT' table unless we CROSSFILTER the relationship to "Both". Example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="php"&gt;StockOUT Qty =
CALCULATE (
    SUM ( StockOUT_entry[Quantity_Units_OUT] ),
    CROSSFILTER ( StockIN_entry[Serial_nr_IN], StockOUT_entry[Serial_nr_OUT], BOTH )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this will not solve the problem because you are slicing by two columns from the Stock-IN table while the relationship utilizes only one column. Here where things get complicated and it even gets more complicated when dealing with the&amp;nbsp;&lt;SPAN&gt;'int_mov'&amp;nbsp; table&amp;nbsp;considering the two columns "From" and "To". And we're still talking about level 1 only!&lt;BR /&gt;That was the bad news. The good news is that there is a simple and efficient solution for that. As I don't have sample file to work with I would advise to do it in two steps. First step is fixing the data model and create proper relationships. 2nd step is writing&amp;nbsp;DAX code which will be simple code.&amp;nbsp;&lt;BR /&gt;&lt;STRONG&gt;STEP 1:&lt;/STRONG&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Create the dimension tables: Since you are using power pivot, creating tables with DAX is not an option but you can easily create the required tables using either excel or power query.&lt;BR /&gt;The first table is a single column table that contains all the unique "Serial Numbers'.&lt;BR /&gt;The 2nd table is a single column table that contains all the unique level 1 HW names.&lt;BR /&gt;The 3rd table is a single column table that contains all the unique&amp;nbsp; level 2 HW names.&lt;/LI&gt;&lt;LI&gt;Now you can start creating the relationship&amp;nbsp;between tables the new tables and the existing ones:&lt;BR /&gt;a. Serial number will connect to the three tables with active relationships.&lt;BR /&gt;b. Level 1 will connect to the&amp;nbsp; three tables with active relationships. For the 'int_MOV' table the active relationship will be with the "From" column and one extra "Inactive" relationship with the "To" column.&lt;BR /&gt;c.&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Level 1 will connect to the&amp;nbsp; three tables with active relationships. For the 'int_MOV' table the active relationship will be with the "From" column and one extra "Inactive" relationship with the "To" column.&lt;/LI&gt;&lt;LI&gt;Level 2 will connect to the&amp;nbsp; three tables with active relationships. For the 'int_MOV' table the active relationship will be with the "From" column and one extra "Inactive" relationship with the "To" column.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Once all relationships are set please share screenshots of the data model then will guide you through the next step.&lt;BR /&gt;Have a great day!&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2022 05:23:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerPivot-measures-calculate-a-quot-SUMIFS-quot-function/m-p/2411162#M63524</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-03-23T05:23:53Z</dc:date>
    </item>
    <item>
      <title>Re: PowerPivot measures: calculate a "SUMIFS" function, connecting 3 tables and 2 different fields</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerPivot-measures-calculate-a-quot-SUMIFS-quot-function/m-p/2972639#M99429</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;first of all, apologies for my super late reply and really thanks so much for your help.&lt;/P&gt;&lt;P&gt;At the end I solved the issue building a bridge table and from it generate a pivot table.&lt;/P&gt;&lt;P&gt;thanks again! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2022 06:56:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/PowerPivot-measures-calculate-a-quot-SUMIFS-quot-function/m-p/2972639#M99429</guid>
      <dc:creator>fedefabio</dc:creator>
      <dc:date>2022-12-16T06:56:37Z</dc:date>
    </item>
  </channel>
</rss>

