<?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: Calculating Prices based on Fixed + Variable Costs in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Prices-based-on-Fixed-Variable-Costs/m-p/1300705#M22511</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="32333" data-lia-user-login="nandukrishnavs" class="lia-mention lia-mention-user"&gt;nandukrishnavs&lt;/a&gt;&amp;nbsp;I've added some rows. Hope this helps&lt;/P&gt;</description>
    <pubDate>Mon, 17 Aug 2020 10:57:38 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-08-17T10:57:38Z</dc:date>
    <item>
      <title>Calculating Prices based on Fixed + Variable Costs</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Prices-based-on-Fixed-Variable-Costs/m-p/1300514#M22503</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi, I could really use some help with the following calculation. let's say we have different categories with both fixed and variable pricing for our customers, based on the package they're in and the number of users our customers have.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;For a 'small customer' the price would be 25USD for up to 10 users, + 2 for every additional (over 10) user.&lt;BR /&gt;For a 'medium customer'the price would be 50USD for up to 25 users, + 1,50 for every additional (over 25 users)&lt;/P&gt;&lt;P&gt;We'd have these columns:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Customer, CustomerType, UserAmount, Price (expected results)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Customer1, Small Customer, 8,&amp;nbsp; 25 (Just the package price (small))&lt;/P&gt;&lt;P&gt;Customer2, Small Customer, 12, 29 (package price (25) + 4 (2 additional users)&lt;/P&gt;&lt;P&gt;Customer 3, Medium Customer, 6, 50 (Package price (medium)&lt;/P&gt;&lt;P&gt;Customer 4, Medium Customer, 35, 65 (Package Price medium + 10 additional users (+1,50)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the customers pay for the package they choose and will have to pay an extra amount if they end up having more users than currently are in the platform.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I calculate this Price column? If possible I'd also like the calculation to include a filter based on CustomerType, because customers could be in customer types, regardless of the amount of users.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Justin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 10:56:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Prices-based-on-Fixed-Variable-Costs/m-p/1300514#M22503</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-17T10:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Prices based on Fixed + Variable Costs</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Prices-based-on-Fixed-Variable-Costs/m-p/1300573#M22506</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide a few rows and expected results&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 10:15:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Prices-based-on-Fixed-Variable-Costs/m-p/1300573#M22506</guid>
      <dc:creator>nandukrishnavs</dc:creator>
      <dc:date>2020-08-17T10:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Prices based on Fixed + Variable Costs</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Prices-based-on-Fixed-Variable-Costs/m-p/1300576#M22507</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please share some sample data in text format and the expected output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Harsh Nathani&lt;BR /&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 10:17:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Prices-based-on-Fixed-Variable-Costs/m-p/1300576#M22507</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-17T10:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Prices based on Fixed + Variable Costs</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Prices-based-on-Fixed-Variable-Costs/m-p/1300660#M22508</link>
      <description>Here's how to ask questions to maximize the chances of an answer:&lt;BR /&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490&lt;/A&gt;</description>
      <pubDate>Mon, 17 Aug 2020 10:48:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Prices-based-on-Fixed-Variable-Costs/m-p/1300660#M22508</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-17T10:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Prices based on Fixed + Variable Costs</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Prices-based-on-Fixed-Variable-Costs/m-p/1300705#M22511</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="32333" data-lia-user-login="nandukrishnavs" class="lia-mention lia-mention-user"&gt;nandukrishnavs&lt;/a&gt;&amp;nbsp;I've added some rows. Hope this helps&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 10:57:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Prices-based-on-Fixed-Variable-Costs/m-p/1300705#M22511</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-17T10:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Prices based on Fixed + Variable Costs</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Prices-based-on-Fixed-Variable-Costs/m-p/1300711#M22512</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;I've added some rows with example output. Hope this helps&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 10:58:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Prices-based-on-Fixed-Variable-Costs/m-p/1300711#M22512</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-17T10:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Prices based on Fixed + Variable Costs</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Prices-based-on-Fixed-Variable-Costs/m-p/1300785#M22515</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a Calculated Column&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = 

SWITCH(
    TRUE(),
    'Table (2)'[Customer Type] = "Small Customer" &amp;amp;&amp;amp; 'Table (2)'[User Amount] &amp;lt;=10 , 25,
    'Table (2)'[Customer Type] = "Small Customer" &amp;amp;&amp;amp; 'Table (2)'[User Amount] &amp;gt;10 , 25 + (('Table (2)'[User Amount] - 10) * 2),
    'Table (2)'[Customer Type] = "Medium Customer" &amp;amp;&amp;amp; 'Table (2)'[User Amount] &amp;lt;=25 , 50,
    'Table (2)'[Customer Type] = "Medium Customer" &amp;amp;&amp;amp; 'Table (2)'[User Amount] &amp;gt; 25 , 50 + (('Table (2)'[User Amount] - 25) * 1.5)
)
&lt;/LI-CODE&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;Regards,&lt;BR /&gt;Harsh Nathani&lt;BR /&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 11:20:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Prices-based-on-Fixed-Variable-Costs/m-p/1300785#M22515</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-17T11:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Prices based on Fixed + Variable Costs</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Prices-based-on-Fixed-Variable-Costs/m-p/1300825#M22519</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try something like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;Price =
VAR __CustomerType = 'MyTable'[ CustomerType]
VAR __UserAmount = 'MyTable'[ UserAmount]
VAR __SmallCustomer =
    IF (
        __CustomerType = "Small Customer",
        IF ( __UserAmount &amp;lt;= 10, 25, ( ( __UserAmount - 10 ) * 2 ) + 25 )
    )
VAR __MediumCustomer =
    IF (
        __CustomerType = "Medium Customer",
        IF ( __UserAmount &amp;lt;= 25, 50, ( ( __UserAmount - 25 ) * 1.5 ) + 50 )
    )
VAR __finalresult =
    SWITCH (
        __CustomerType,
        "Small Customer", __SmallCustomer,
        "Medium Customer", __MediumCustomer
    )
RETURN
    __finalresult&lt;/LI-CODE&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;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution!&lt;BR /&gt;Appreciate with a kudos &lt;/STRONG&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 11:30:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Prices-based-on-Fixed-Variable-Costs/m-p/1300825#M22519</guid>
      <dc:creator>nandukrishnavs</dc:creator>
      <dc:date>2020-08-17T11:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Prices based on Fixed + Variable Costs</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Prices-based-on-Fixed-Variable-Costs/m-p/1300908#M22522</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Another option using DATATABLE.&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;Price = 
VAR __table =
    DATATABLE (
        "Type", STRING,
        "Limit", INTEGER,
        "Amount", CURRENCY,
        "Extra", DOUBLE,
        {
            { "Small Customer", 10, 25, 2 },
            { "Medium Customer", 25, 50, 1.5 }
        }
    )
VAR __CustomerType = 'MyTable'[ CustomerType]
VAR __UserAmount = 'MyTable'[ UserAmount]
VAR __Limit =
    MAXX ( FILTER ( __table, [Type] = __CustomerType ), [Limit] )
VAR __Amount =
    MAXX ( FILTER ( __table, [Type] = __CustomerType ), [Amount] )
VAR __Extra =
    MAXX ( FILTER ( __table, [Type] = __CustomerType ), [Extra] )
VAR __Result =
    IF (
        __UserAmount &amp;lt;= __Limit,
        __Amount,
        __Amount + ( ( __UserAmount - __Limit ) * __Extra )
    )
RETURN
    __Result&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution!&lt;BR /&gt;Appreciate with a kudos &lt;/STRONG&gt;&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;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Aug 2020 11:51:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Prices-based-on-Fixed-Variable-Costs/m-p/1300908#M22522</guid>
      <dc:creator>nandukrishnavs</dc:creator>
      <dc:date>2020-08-17T11:51:07Z</dc:date>
    </item>
  </channel>
</rss>

