<?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 Request Assistance:DAX Formula to Calculate Surplus based on differing contract minimums by location in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Request-Assistance-DAX-Formula-to-Calculate-Surplus-based-on/m-p/3760964#M146723</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Been looking and couldn't find anything that would help me with this one. I have different locations with different contract minimums. I have a dax measure for total sales and then I want to calculate the revenue surplus based on the contract minimum for a location. Essentially subtracting the location-specific contract minimum amount from the total sales amount for that location.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have looked in a bunch of places to recreate a 'nested if' and I'm stumped. Here's the current table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The 'Revenue Surplus' measure being used right now just takes the total sales measure and subtracts $1,000. I need to be able to change that amount based on the location. All of the data is in one table and the only measures from that table are 'Total Sales' and 'Revenue Surplus.'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'Total Sales'= SUM(Sales)&lt;/P&gt;&lt;P&gt;'Revenue Surplus'= [Total Sales]-1000 (this is the one I need to change)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated. Thank you!&lt;/P&gt;</description>
    <pubDate>Wed, 13 Mar 2024 16:10:40 GMT</pubDate>
    <dc:creator>KMGC</dc:creator>
    <dc:date>2024-03-13T16:10:40Z</dc:date>
    <item>
      <title>Request Assistance:DAX Formula to Calculate Surplus based on differing contract minimums by location</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Request-Assistance-DAX-Formula-to-Calculate-Surplus-based-on/m-p/3760964#M146723</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Been looking and couldn't find anything that would help me with this one. I have different locations with different contract minimums. I have a dax measure for total sales and then I want to calculate the revenue surplus based on the contract minimum for a location. Essentially subtracting the location-specific contract minimum amount from the total sales amount for that location.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have looked in a bunch of places to recreate a 'nested if' and I'm stumped. Here's the current table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The 'Revenue Surplus' measure being used right now just takes the total sales measure and subtracts $1,000. I need to be able to change that amount based on the location. All of the data is in one table and the only measures from that table are 'Total Sales' and 'Revenue Surplus.'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;'Total Sales'= SUM(Sales)&lt;/P&gt;&lt;P&gt;'Revenue Surplus'= [Total Sales]-1000 (this is the one I need to change)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be appreciated. Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2024 16:10:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Request-Assistance-DAX-Formula-to-Calculate-Surplus-based-on/m-p/3760964#M146723</guid>
      <dc:creator>KMGC</dc:creator>
      <dc:date>2024-03-13T16:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: Request Assistance:DAX Formula to Calculate Surplus based on differing contract minimums by location</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Request-Assistance-DAX-Formula-to-Calculate-Surplus-based-on/m-p/3762088#M146791</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="625464" data-lia-user-login="KMGC" class="lia-mention lia-mention-user"&gt;KMGC&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try this:&lt;/P&gt;
&lt;P&gt;First of all, I create a set of sample:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;And you need to create a new table to store contract minimums:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then create a 1:* relationship between the two tables:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then add 2 measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;TOTAL = SUM('Table'[Total Sales])&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Revenus =
[TOTAL]
    - CALCULATE (
        MAX ( 'Table (2)'[contract minimums] ),
        'Table (2)'[Location] = SELECTEDVALUE ( 'Table'[Location] )
    )
&lt;/LI-CODE&gt;
&lt;P&gt;The result is as follow:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Zhengdong Xu&lt;BR /&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&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;&lt;EM&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 02:27:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Request-Assistance-DAX-Formula-to-Calculate-Surplus-based-on/m-p/3762088#M146791</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-14T02:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: Request Assistance:DAX Formula to Calculate Surplus based on differing contract minimums by location</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Request-Assistance-DAX-Formula-to-Calculate-Surplus-based-on/m-p/3763499#M146864</link>
      <description>&lt;P&gt;Works perfectly. Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2024 12:02:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Request-Assistance-DAX-Formula-to-Calculate-Surplus-based-on/m-p/3763499#M146864</guid>
      <dc:creator>KMGC</dc:creator>
      <dc:date>2024-03-14T12:02:27Z</dc:date>
    </item>
  </channel>
</rss>

