<?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: calculate the diffrence in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-diffrence/m-p/3668893#M142264</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="477984" data-lia-user-login="Sofinobi" class="lia-mention lia-mention-user"&gt;Sofinobi&lt;/a&gt;&amp;nbsp;This looks like a measure aggregation problem. See my blog article about that here: &lt;A href="https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The pattern is: &lt;BR /&gt;MinScoreMeasure = MINX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])&lt;BR /&gt;MaxScoreMeasure = MAXX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])&lt;BR /&gt;AvgScoreMeasure = AVERAGEX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])&lt;BR /&gt;etc.&lt;/P&gt;</description>
    <pubDate>Tue, 30 Jan 2024 19:35:59 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2024-01-30T19:35:59Z</dc:date>
    <item>
      <title>calculate the diffrence</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-diffrence/m-p/3668860#M142261</link>
      <description>&lt;P&gt;hi all,&lt;BR /&gt;please, i have a measure to calculate the diffrence between the Sales and Target (Diff = Sales - Target), when i visualize this in a Table by Client, so i have positive and negative results (it depends on Sales by Client),&lt;/P&gt;&lt;P&gt;i would like to calculate the &lt;STRONG&gt;Sum&lt;/STRONG&gt; of&lt;STRONG&gt; Diff&lt;/STRONG&gt; only for the negatives results.&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;thank you so much&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2024 18:58:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-diffrence/m-p/3668860#M142261</guid>
      <dc:creator>Sofinobi</dc:creator>
      <dc:date>2024-01-30T18:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: calculate the diffrence</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-diffrence/m-p/3668893#M142264</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="477984" data-lia-user-login="Sofinobi" class="lia-mention lia-mention-user"&gt;Sofinobi&lt;/a&gt;&amp;nbsp;This looks like a measure aggregation problem. See my blog article about that here: &lt;A href="https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The pattern is: &lt;BR /&gt;MinScoreMeasure = MINX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])&lt;BR /&gt;MaxScoreMeasure = MAXX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])&lt;BR /&gt;AvgScoreMeasure = AVERAGEX ( SUMMARIZE ( Table, Table[Group] , "Measure",[YourMeasure] ), [Measure])&lt;BR /&gt;etc.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2024 19:35:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-diffrence/m-p/3668893#M142264</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2024-01-30T19:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: calculate the diffrence</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-diffrence/m-p/3669373#M142298</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="477984" data-lia-user-login="Sofinobi" class="lia-mention lia-mention-user"&gt;Sofinobi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using below to simulate your use case. This will give you sum of negative numbers, you need to replace summarize with your visual level filters if any or otherwise with table column that you want to group by(Example difference for products here).&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Replace it with your measure that returns the difference.(&lt;/SPAN&gt;&lt;SPAN&gt;[MQuantity]&lt;/SPAN&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;SPAN&gt;[MCustomQuantity]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;MDiff =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SUMX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;SUMMARIZE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DimProduct&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;DimProduct&lt;/SPAN&gt;&lt;SPAN&gt;[EnglishProductName]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;Diff&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;[MQuantity]&lt;/SPAN&gt;&lt;SPAN&gt;- &lt;/SPAN&gt;&lt;SPAN&gt;[MCustomQuantity]&lt;/SPAN&gt;&lt;SPAN&gt; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Diff&lt;/SPAN&gt;&lt;SPAN&gt; &amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;Diff&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;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&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;</description>
      <pubDate>Wed, 31 Jan 2024 03:35:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-diffrence/m-p/3669373#M142298</guid>
      <dc:creator>talespin</dc:creator>
      <dc:date>2024-01-31T03:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: calculate the diffrence</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-diffrence/m-p/3669748#M142321</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="477984" data-lia-user-login="Sofinobi" class="lia-mention lia-mention-user"&gt;Sofinobi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope all is going well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From your description, you want to create a new measure in Power BI that will sum only the negative differences between Sales and Target for each client.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please follow these steps:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. First, here is my sample data.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Create a measure value. The specific syntax is as follows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Diff =
VAR a = MAX([Sales])-MAX([Target])
RETURN
IF(a &amp;lt; 0, a, 0)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The visual object presented at this time is as follows.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. If you want to display only negative numbers in the visual, you can format it in Filter as follows.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The visual objects at this time are as follows.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your needs should now be met. If you encounter any problems, please feel free to contact me. Thank you for your patience and cooperation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Warm Regards,&lt;BR /&gt;Yang&lt;BR /&gt;Community Support Team&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;&amp;nbsp;to help the other members find it more quickly.&lt;BR /&gt;If I misunderstand your needs or you still have problems on it, please feel free to let us know.&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Thanks a lot!&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 08:29:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-diffrence/m-p/3669748#M142321</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-01-31T08:29:47Z</dc:date>
    </item>
    <item>
      <title>Re: calculate the diffrence</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-diffrence/m-p/3670923#M142405</link>
      <description>&lt;P&gt;thank you&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp; it works perfectly, thats exactely what i'm looking for.&lt;/P&gt;&lt;P&gt;thank you again&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 17:04:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-diffrence/m-p/3670923#M142405</guid>
      <dc:creator>Sofinobi</dc:creator>
      <dc:date>2024-01-31T17:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: calculate the diffrence</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-diffrence/m-p/3670932#M142407</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="678168" data-lia-user-login="talespin" class="lia-mention lia-mention-user"&gt;talespin&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;thank you so much, it works perfectly.&lt;/P&gt;&lt;P&gt;thank you again my friend&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jan 2024 17:07:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-diffrence/m-p/3670932#M142407</guid>
      <dc:creator>Sofinobi</dc:creator>
      <dc:date>2024-01-31T17:07:17Z</dc:date>
    </item>
    <item>
      <title>Re: calculate the diffrence</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-diffrence/m-p/3673228#M142516</link>
      <description>&lt;P&gt;You're welcome&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2024 14:58:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-diffrence/m-p/3673228#M142516</guid>
      <dc:creator>talespin</dc:creator>
      <dc:date>2024-02-01T14:58:23Z</dc:date>
    </item>
  </channel>
</rss>

