<?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: Computing totals by summing visible values (based on measure) row by row in DAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Computing-totals-by-summing-visible-values-based-on-measure-row/m-p/3123815#M110893</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The proposed solution was good enough for the time being, so I accepted yi as solution.&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="520150" data-lia-user-login="andhiii079845" class="lia-mention lia-mention-user"&gt;andhiii079845&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Mar 2023 11:19:08 GMT</pubDate>
    <dc:creator>ikavaju</dc:creator>
    <dc:date>2023-03-10T11:19:08Z</dc:date>
    <item>
      <title>Computing totals by summing visible values (based on measure) row by row in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Computing-totals-by-summing-visible-values-based-on-measure-row/m-p/3110288#M109832</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a issue to calculate a measure in a way that it gives the result on row level and on total level in the same measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have managed to calculate two different measures, neither of those give the proper putcome.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;Spend saving potential = &lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;CALCULATE(&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;SUMX('Table', 'Table'[QUANTITY])&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;*&amp;nbsp;&lt;/EM&gt;&lt;EM&gt;[Material Price saving potential to Category price Avg]&amp;nbsp;&amp;nbsp;&lt;/EM&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;EM&gt;Spend saving potential option2 =&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;SUMX(&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; VALUES('Table'[Material] ),&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;&amp;nbsp; &amp;nbsp; IF([Spend saving potential] &amp;gt;0, [Spend saving potential])&lt;/EM&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;EM&gt;)&lt;/EM&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As can be seen in the picture below, the "Spend saving potential" is the aggregated savings of materials where the material average price is over the correspondedcategory averages. If material prices are under category avg prices, those are blanked out.&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;&amp;nbsp;&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;&lt;P&gt;&amp;nbsp;&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The link PBIX file&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/19DQW4kovKCk9zn6OkPCqJty0aLc3zkzj/view?usp=sharing" target="_blank"&gt;https://drive.google.com/file/d/19DQW4kovKCk9zn6OkPCqJty0aLc3zkzj/view?usp=sharing&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks if you can solve this!&lt;/P&gt;</description>
      <pubDate>Fri, 03 Mar 2023 12:47:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Computing-totals-by-summing-visible-values-based-on-measure-row/m-p/3110288#M109832</guid>
      <dc:creator>ikavaju</dc:creator>
      <dc:date>2023-03-03T12:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: Computing totals by summing visible values (based on measure) row by row in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Computing-totals-by-summing-visible-values-based-on-measure-row/m-p/3111035#M109897</link>
      <description>&lt;P&gt;Thank you for direct sharing your PBI. I make it more easier for helping.&lt;BR /&gt;Try this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;SPAN&gt;Combine = &lt;BR /&gt;VAR _cat = CALCULATE(&lt;BR /&gt;SUMX('Table', 'Table'[QUANTITY])&lt;BR /&gt;*&lt;BR /&gt;[Material Price saving potential to Category price Avg]&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;VAR _mat = SUMX(&lt;BR /&gt;&amp;nbsp; &amp;nbsp; VALUES('Table'[Material]),&lt;BR /&gt;&amp;nbsp; &amp;nbsp; IF([Spend saving potential] &amp;gt;0, [Spend saving potential]))&lt;BR /&gt;RETURN&lt;BR /&gt;&lt;BR /&gt;IF(HASONEFILTER('Table'[Material]),_cat,_mat)&lt;/SPAN&gt;&lt;/PRE&gt;&lt;DIV&gt;&amp;nbsp;&lt;DIV&gt;&lt;DIV class=""&gt;&lt;BR /&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;DIV class=""&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 03 Mar 2023 19:16:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Computing-totals-by-summing-visible-values-based-on-measure-row/m-p/3111035#M109897</guid>
      <dc:creator>andhiii079845</dc:creator>
      <dc:date>2023-03-03T19:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: Computing totals by summing visible values (based on measure) row by row in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Computing-totals-by-summing-visible-values-based-on-measure-row/m-p/3115725#M110302</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks for your answer&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="520150" data-lia-user-login="andhiii079845" class="lia-mention lia-mention-user"&gt;andhiii079845&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In a way, this resolve the case.&lt;/P&gt;&lt;P&gt;However I wonder is there more "sophicticated / simplified" measure, which would automatically calculate desired outcome (one code for rows and also for totals) without using this kind of "workaround" where the code is longer and more complicated.&lt;BR /&gt;In other words, I am lacking understanding why "Spend saving potential" does not produce value for total? And also lacking understanding why "option2" does not give values for matrix rows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for support!&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 08:09:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Computing-totals-by-summing-visible-values-based-on-measure-row/m-p/3115725#M110302</guid>
      <dc:creator>ikavaju</dc:creator>
      <dc:date>2023-03-07T08:09:23Z</dc:date>
    </item>
    <item>
      <title>Re: Computing totals by summing visible values (based on measure) row by row in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Computing-totals-by-summing-visible-values-based-on-measure-row/m-p/3115970#M110314</link>
      <description>&lt;P&gt;I have to look later in the pbi again to answer your question in general you want to combine to different measures which have different filters and one a "group by" per&amp;nbsp;&lt;EM&gt;'Table'[Material]&lt;/EM&gt;&amp;nbsp;. So you have to decide what you want to show when.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;In other words, I am lacking understanding why "Spend saving potential" does not produce value for total? &lt;BR /&gt;&lt;/SPAN&gt;And also lacking understanding why "option2" does not give values for matrix rows.&lt;/PRE&gt;&lt;P&gt;Do you mean no totals of the level of the Category? Can you explain more in detail what do you not understand, please? I think (not 100 % sure) you have blank values in the measure ([Material Price saving potential to Category price Avg]) so he can not give a total back for the category or total.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2023 09:53:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Computing-totals-by-summing-visible-values-based-on-measure-row/m-p/3115970#M110314</guid>
      <dc:creator>andhiii079845</dc:creator>
      <dc:date>2023-03-07T09:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: Computing totals by summing visible values (based on measure) row by row in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Computing-totals-by-summing-visible-values-based-on-measure-row/m-p/3123815#M110893</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The proposed solution was good enough for the time being, so I accepted yi as solution.&lt;/P&gt;&lt;P&gt;Thank you&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="520150" data-lia-user-login="andhiii079845" class="lia-mention lia-mention-user"&gt;andhiii079845&lt;/a&gt;&amp;nbsp;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Mar 2023 11:19:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Computing-totals-by-summing-visible-values-based-on-measure-row/m-p/3123815#M110893</guid>
      <dc:creator>ikavaju</dc:creator>
      <dc:date>2023-03-10T11:19:08Z</dc:date>
    </item>
  </channel>
</rss>

