<?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 Semi-additive summing in Power Pivot - filtering on largest product in each line in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Semi-additive-summing-in-Power-Pivot-filtering-on-largest/m-p/3180843#M114989</link>
    <description>&lt;P&gt;I'm hoping to get some help building a measure that doesn't double-count - and my fact table double-counts. I've got an Exposure fact table with FK Product. A customer can purchase multiple products from each product line. Exposure[Product] is related to Products[Product] (PK). I want to sum over Exposure[Value], filtering only on the Products[Product] values that generate the largest Exposure[Value] sum in each Products[Product Line]. I'm so stuck.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's my thought process:&lt;/P&gt;&lt;P&gt;1. Determine the largest product in each product line. There's only one slicer right now on Products[Product] - as we may want to dynamically exclude some products from consideration. Don't know how to do this. I visualize this as taking the pre-filtered Products table, adding a column for sum(Exposure[Value]), grouping by [Product Line], calculating each group maximum, filtering to only keep each group max line, and returning the values of Products[Product]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Create a largest total measure using this. Since I'm new, I'm sure I don't have the syntax right, but this seems easier. Something like Largest Total := calculate(sum(Exposure[Value], filter(Products[Product] IN (variable from 1)))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please note, I am restricted to using Power Pivot in Excel. Figuring out how the calculated tables work has been challenging &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;Any suggestions would be greatly appreciated. Thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 11 Apr 2023 03:04:44 GMT</pubDate>
    <dc:creator>karen578</dc:creator>
    <dc:date>2023-04-11T03:04:44Z</dc:date>
    <item>
      <title>Semi-additive summing in Power Pivot - filtering on largest product in each line</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Semi-additive-summing-in-Power-Pivot-filtering-on-largest/m-p/3180843#M114989</link>
      <description>&lt;P&gt;I'm hoping to get some help building a measure that doesn't double-count - and my fact table double-counts. I've got an Exposure fact table with FK Product. A customer can purchase multiple products from each product line. Exposure[Product] is related to Products[Product] (PK). I want to sum over Exposure[Value], filtering only on the Products[Product] values that generate the largest Exposure[Value] sum in each Products[Product Line]. I'm so stuck.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's my thought process:&lt;/P&gt;&lt;P&gt;1. Determine the largest product in each product line. There's only one slicer right now on Products[Product] - as we may want to dynamically exclude some products from consideration. Don't know how to do this. I visualize this as taking the pre-filtered Products table, adding a column for sum(Exposure[Value]), grouping by [Product Line], calculating each group maximum, filtering to only keep each group max line, and returning the values of Products[Product]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Create a largest total measure using this. Since I'm new, I'm sure I don't have the syntax right, but this seems easier. Something like Largest Total := calculate(sum(Exposure[Value], filter(Products[Product] IN (variable from 1)))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please note, I am restricted to using Power Pivot in Excel. Figuring out how the calculated tables work has been challenging &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;Any suggestions would be greatly appreciated. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 03:04:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Semi-additive-summing-in-Power-Pivot-filtering-on-largest/m-p/3180843#M114989</guid>
      <dc:creator>karen578</dc:creator>
      <dc:date>2023-04-11T03:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: Semi-additive summing in Power Pivot - filtering on largest product in each line</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Semi-additive-summing-in-Power-Pivot-filtering-on-largest/m-p/3180875#M114991</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure how your datamodel looks like, but I tried to create a sample pbix file like below.&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbix file.&lt;/P&gt;
&lt;P&gt;I hope the below can provide some ideas on how to create a solution for your datamodel.&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;LI-CODE lang="markup"&gt;Expected result measure: =
SUMX ( VALUES ( Data[Product line] ), CALCULATE ( MAX ( Data[Value] ) ) )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 03:26:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Semi-additive-summing-in-Power-Pivot-filtering-on-largest/m-p/3180875#M114991</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2023-04-11T03:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: Semi-additive summing in Power Pivot - filtering on largest product in each line</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Semi-additive-summing-in-Power-Pivot-filtering-on-largest/m-p/3182440#M115086</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;, thanks - I saw some other posts similar to this, and I couldn't make the sumx work for me. A few complicating factors:&lt;/P&gt;&lt;P&gt;1 - I need to get group sums before taking the max - I have multiple records of Data[Value] for each Data[Product Line], and max(Data[Value]) just takes the largest individual record.&lt;/P&gt;&lt;P&gt;2 - I'm hoping to take this a step further and identify the top products by name. Instead of 57, 80, 96, 72 - I would have a 1 column table showing P01, P04, P10 and P15 - with my data, ties aren't possible and there will be a unique winner.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 17:58:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Semi-additive-summing-in-Power-Pivot-filtering-on-largest/m-p/3182440#M115086</guid>
      <dc:creator>karen578</dc:creator>
      <dc:date>2023-04-11T17:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: Semi-additive summing in Power Pivot - filtering on largest product in each line</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Semi-additive-summing-in-Power-Pivot-filtering-on-largest/m-p/3182624#M115095</link>
      <description>&lt;P&gt;I've been able to make some possible progress on this in Power BI by creating 2 calculated tables, but am still stuck.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's what I did.&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Created a table to summarize totals by Product Line and Product:&lt;/P&gt;&lt;P&gt;Table 3 = summarizecolumns(Data[Product Line], Data[Product], "Total", sumx(Data, Data[Value]))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Created a table off of Table 3 to return a list of only the max products&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Max Lines = &lt;/SPAN&gt;&lt;SPAN&gt;SELECTCOLUMNS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SUMMARIZECOLUMNS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Table 3'&lt;/SPAN&gt;&lt;SPAN&gt;[Product Line]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;"Product"&lt;/SPAN&gt;&lt;SPAN&gt;, &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;(Data[Product]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;filter&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Table 3'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;[Total]&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;'Table 3'&lt;/SPAN&gt;&lt;SPAN&gt;[Total]&lt;/SPAN&gt;&lt;SPAN&gt;)))), &lt;/SPAN&gt;&lt;SPAN&gt;"Product"&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;[Product]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;3. Created a filtered total measure using the list in Max Lines as a filter:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;filtered total = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;calculate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[value]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;filter&lt;/SPAN&gt;&lt;SPAN&gt;(Data&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Data&lt;/SPAN&gt;&lt;SPAN&gt;[Product]&lt;/SPAN&gt; &lt;SPAN&gt;IN&lt;/SPAN&gt; &lt;SPAN&gt;values&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Max Lines'&lt;/SPAN&gt;&lt;SPAN&gt;[Product]&lt;/SPAN&gt;&lt;SPAN&gt;)))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Not sure if this is a decent approach and I'm still having 2 issues:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;1.&amp;nbsp; My first calculated table is not respecting the filter I have on Data[Product] - if the user isn't selecting this in the slicer, I'd like it to show 0/blank so that another Product can be chosen as the max&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;2. Since I need to ultimately do this in Power Pivot, I can't be calculating additional tables. I tried to put these intermediate values (tables) into variables, but I'm not sure how to reference columns in variables.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 11 Apr 2023 20:02:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Semi-additive-summing-in-Power-Pivot-filtering-on-largest/m-p/3182624#M115095</guid>
      <dc:creator>karen578</dc:creator>
      <dc:date>2023-04-11T20:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: Semi-additive summing in Power Pivot - filtering on largest product in each line</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Semi-additive-summing-in-Power-Pivot-filtering-on-largest/m-p/3182986#M115119</link>
      <description>&lt;P&gt;If anyone comes across this, I figured it out! The measure defined here for "Sales Top 3 Products" using the topn and keepfilters functions was exactly what I was looking for:&amp;nbsp;&lt;A href="https://www.daxpatterns.com/ranking/" target="_blank"&gt;Ranking – DAX Patterns&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 02:27:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Semi-additive-summing-in-Power-Pivot-filtering-on-largest/m-p/3182986#M115119</guid>
      <dc:creator>karen578</dc:creator>
      <dc:date>2023-04-12T02:27:40Z</dc:date>
    </item>
  </channel>
</rss>

