<?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: Dax for Bonus Threshold in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-for-Bonus-Threshold/m-p/3718955#M144795</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;Thanks for the quick reply, I assumed some data.&lt;/P&gt;&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="494411" data-lia-user-login="Tarek78" class="lia-mention lia-mention-user"&gt;Tarek78&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The table data is shown below:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Please follow these steps:&lt;BR /&gt;1. Use the following DAX expression to create a measure named ‘Product A Sales Bonus’&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Product A Sales Bonus =
VAR _a =
    DIVIDE (
        SUMX (
            'Tabelle1',
            'Tabelle1'[Sales of product A this year] - 'Tabelle1'[Sales of product A last year]
        ),
        SUMX ( 'Tabelle1', 'Tabelle1'[Sales of product A last year] ),
        0
    ) * 100
VAR _c =
    SUMX (
        'Tabelle1',
        [Sales of product A this year] - [Sales of product A last year]
    )
VAR _b =
    IF (
        SUM ( Tabelle1[Sales of product A this year] ) &amp;gt;= 1000000,
        SWITCH (
            TRUE (),
            _a &amp;lt; 10, SUM ( Tabelle1[Sales of product A this year] ) * 0.01,
            _a = 10,
                SUM ( Tabelle1[Sales of product A this year] ) * 0.01 + _c * 0.02,
            _a &amp;gt; 10
                &amp;amp;&amp;amp; _a &amp;lt;= 15,
                SUM ( Tabelle1[Sales of product A this year] ) * 0.01 + _c * 0.03
        ),
        SWITCH (
            TRUE (),
            _a &amp;lt; 10, 0,
            _a = 10, _c * 0.02,
            _a &amp;gt; 10
                &amp;amp;&amp;amp; _a &amp;lt;= 15, _c * 0.03
        )
    )
RETURN
    _b&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Use the following DAX expression to create a measure named ‘Total Revenue Bonus’&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Total Revenue Bonus =
IF (
    EXACT ( MAXX ( 'Tabelle1', [Type] ), "customer1" ),
    SWITCH (
        TRUE (),
        SUM ( Tabelle1[Total revenue] ) &amp;lt; 1000000, 0,
        SUM ( Tabelle1[Total revenue] ) &amp;gt;= 1000000
            &amp;amp;&amp;amp; SUM ( Tabelle1[Total revenue] ) &amp;lt; 2000000, SUM ( Tabelle1[Total revenue] ) * 0.05,
        SUM ( Tabelle1[Total revenue] ) &amp;gt; 2000000, SUM ( Tabelle1[Total revenue] ) * 0.07
    ),
    SWITCH (
        TRUE (),
        SUM ( Tabelle1[Total revenue] ) &amp;lt; 2000000, 0,
        SUM ( Tabelle1[Total revenue] ) &amp;gt;= 2000000
            &amp;amp;&amp;amp; SUM ( Tabelle1[Total revenue] ) &amp;lt; 5000000, SUM ( Tabelle1[Total revenue] ) * 0.07,
        SUM ( Tabelle1[Total revenue] ) &amp;gt; 5000000, SUM ( Tabelle1[Total revenue] ) * 0.08
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;3. Use the following DAX expression to create a measure named ‘Total Bonus’&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Total Bonus = [Product A Sales Bonus] + [Total Revenue Bonus]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4. Final output&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Wenbin Zhou&lt;/P&gt;&lt;P&gt;If this post &lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
    <pubDate>Fri, 23 Feb 2024 06:29:25 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-02-23T06:29:25Z</dc:date>
    <item>
      <title>Dax for Bonus Threshold</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-for-Bonus-Threshold/m-p/3718341#M144773</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We give our customers a bonus based on various conditions. Those conditions are different per customer but the same logic.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;example:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;customer 1: if revenue &amp;lt; 1M€, no bonus. Between 1M and 2M, 5% of sales as bonus, above 2M, 7% of bonus&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;customer 2: if revenue &amp;lt; 2M€, no bonus. Between 2M and 5M, 7% of sales as bonus, above 5M, 8% of bonus&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1% of sales on product A is more than 1 M&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2% on the growth (revenue current year - revenue last year) if growth is 10%, 3% if the growth is between 10 and 15%&lt;BR /&gt;&lt;BR /&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;I am looking at a way to build a DAx formula and why not a data model.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;do you have any idea ?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Feb 2024 22:50:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-for-Bonus-Threshold/m-p/3718341#M144773</guid>
      <dc:creator>Tarek78</dc:creator>
      <dc:date>2024-02-22T22:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: Dax for Bonus Threshold</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-for-Bonus-Threshold/m-p/3718467#M144781</link>
      <description>&lt;P&gt;That's a standard prorated pattern.&amp;nbsp; Why not a data model, indeed?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;&lt;BR /&gt;Do not include sensitive information or anything not related to the issue or question. &lt;BR /&gt;&lt;BR /&gt;If you are unsure how to upload data please refer to &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 01:32:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-for-Bonus-Threshold/m-p/3718467#M144781</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-02-23T01:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Dax for Bonus Threshold</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-for-Bonus-Threshold/m-p/3718955#M144795</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;Thanks for the quick reply, I assumed some data.&lt;/P&gt;&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="494411" data-lia-user-login="Tarek78" class="lia-mention lia-mention-user"&gt;Tarek78&lt;/a&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The table data is shown below:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Please follow these steps:&lt;BR /&gt;1. Use the following DAX expression to create a measure named ‘Product A Sales Bonus’&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Product A Sales Bonus =
VAR _a =
    DIVIDE (
        SUMX (
            'Tabelle1',
            'Tabelle1'[Sales of product A this year] - 'Tabelle1'[Sales of product A last year]
        ),
        SUMX ( 'Tabelle1', 'Tabelle1'[Sales of product A last year] ),
        0
    ) * 100
VAR _c =
    SUMX (
        'Tabelle1',
        [Sales of product A this year] - [Sales of product A last year]
    )
VAR _b =
    IF (
        SUM ( Tabelle1[Sales of product A this year] ) &amp;gt;= 1000000,
        SWITCH (
            TRUE (),
            _a &amp;lt; 10, SUM ( Tabelle1[Sales of product A this year] ) * 0.01,
            _a = 10,
                SUM ( Tabelle1[Sales of product A this year] ) * 0.01 + _c * 0.02,
            _a &amp;gt; 10
                &amp;amp;&amp;amp; _a &amp;lt;= 15,
                SUM ( Tabelle1[Sales of product A this year] ) * 0.01 + _c * 0.03
        ),
        SWITCH (
            TRUE (),
            _a &amp;lt; 10, 0,
            _a = 10, _c * 0.02,
            _a &amp;gt; 10
                &amp;amp;&amp;amp; _a &amp;lt;= 15, _c * 0.03
        )
    )
RETURN
    _b&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Use the following DAX expression to create a measure named ‘Total Revenue Bonus’&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Total Revenue Bonus =
IF (
    EXACT ( MAXX ( 'Tabelle1', [Type] ), "customer1" ),
    SWITCH (
        TRUE (),
        SUM ( Tabelle1[Total revenue] ) &amp;lt; 1000000, 0,
        SUM ( Tabelle1[Total revenue] ) &amp;gt;= 1000000
            &amp;amp;&amp;amp; SUM ( Tabelle1[Total revenue] ) &amp;lt; 2000000, SUM ( Tabelle1[Total revenue] ) * 0.05,
        SUM ( Tabelle1[Total revenue] ) &amp;gt; 2000000, SUM ( Tabelle1[Total revenue] ) * 0.07
    ),
    SWITCH (
        TRUE (),
        SUM ( Tabelle1[Total revenue] ) &amp;lt; 2000000, 0,
        SUM ( Tabelle1[Total revenue] ) &amp;gt;= 2000000
            &amp;amp;&amp;amp; SUM ( Tabelle1[Total revenue] ) &amp;lt; 5000000, SUM ( Tabelle1[Total revenue] ) * 0.07,
        SUM ( Tabelle1[Total revenue] ) &amp;gt; 5000000, SUM ( Tabelle1[Total revenue] ) * 0.08
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;3. Use the following DAX expression to create a measure named ‘Total Bonus’&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Total Bonus = [Product A Sales Bonus] + [Total Revenue Bonus]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;4. Final output&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Wenbin Zhou&lt;/P&gt;&lt;P&gt;If this post &lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 06:29:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-for-Bonus-Threshold/m-p/3718955#M144795</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-23T06:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: Dax for Bonus Threshold</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-for-Bonus-Threshold/m-p/3719637#M144818</link>
      <description>&lt;P&gt;Thanks for your reply. I agree, the easiest and my preferred option would be to create a data model where we will use excel files to compile all the different bonuses and thresholds.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;However I'm not sure how to build this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 11:16:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-for-Bonus-Threshold/m-p/3719637#M144818</guid>
      <dc:creator>Tarek78</dc:creator>
      <dc:date>2024-02-23T11:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: Dax for Bonus Threshold</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-for-Bonus-Threshold/m-p/3719649#M144820</link>
      <description>&lt;P&gt;Thanks so much for your help, I will try to understand and follow your formula.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;my preferred option would be to create a data model. Do you have knowledge on this? Maybe I could send the details in excel and we could find together the best data model to create ?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Feb 2024 11:18:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Dax-for-Bonus-Threshold/m-p/3719649#M144820</guid>
      <dc:creator>Tarek78</dc:creator>
      <dc:date>2024-02-23T11:18:48Z</dc:date>
    </item>
  </channel>
</rss>

