<?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 DAX to compute measures based on multiple table and conditions in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-compute-measures-based-on-multiple-table-and-conditions/m-p/2511107#M69650</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have come here believing that the community will be able to help me with a solution.&lt;/P&gt;&lt;P&gt;I’m crashing my head to achieve the below result. I have two tables, the first table with the sales amount made by the agent and the second table is the eligibility criteria for the incentives.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First table&lt;/P&gt;&lt;P&gt;For example, agent 1 has made a sales of 10usd.&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;Second table&lt;/P&gt;&lt;P&gt;There are different types of incentive calculated, if the agent generates sales amount between 0 and 10 he is eligible for 5%, i.e. 0.5usd&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;And below is the expected result. i.e. I want to see the agent and their different incentive type and amount. &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;Please help, Thanks in advance!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 12 May 2022 16:17:43 GMT</pubDate>
    <dc:creator>p_rathinavel</dc:creator>
    <dc:date>2022-05-12T16:17:43Z</dc:date>
    <item>
      <title>DAX to compute measures based on multiple table and conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-compute-measures-based-on-multiple-table-and-conditions/m-p/2511107#M69650</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have come here believing that the community will be able to help me with a solution.&lt;/P&gt;&lt;P&gt;I’m crashing my head to achieve the below result. I have two tables, the first table with the sales amount made by the agent and the second table is the eligibility criteria for the incentives.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First table&lt;/P&gt;&lt;P&gt;For example, agent 1 has made a sales of 10usd.&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;Second table&lt;/P&gt;&lt;P&gt;There are different types of incentive calculated, if the agent generates sales amount between 0 and 10 he is eligible for 5%, i.e. 0.5usd&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;And below is the expected result. i.e. I want to see the agent and their different incentive type and amount. &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;Please help, Thanks in advance!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 16:17:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-compute-measures-based-on-multiple-table-and-conditions/m-p/2511107#M69650</guid>
      <dc:creator>p_rathinavel</dc:creator>
      <dc:date>2022-05-12T16:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to compute measures based on multiple table and conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-compute-measures-based-on-multiple-table-and-conditions/m-p/2511116#M69651</link>
      <description>&lt;P&gt;Hi, the above example is just for one agent, as there are many and many incentive types, i'm struggling.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 16:20:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-compute-measures-based-on-multiple-table-and-conditions/m-p/2511116#M69651</guid>
      <dc:creator>p_rathinavel</dc:creator>
      <dc:date>2022-05-12T16:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to compute measures based on multiple table and conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-compute-measures-based-on-multiple-table-and-conditions/m-p/2511135#M69653</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="179903" data-lia-user-login="Whitewater100" class="lia-mention lia-mention-user"&gt;Whitewater100&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="377293" data-lia-user-login="SpartaBI" class="lia-mention lia-mention-user"&gt;SpartaBI&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="291628" data-lia-user-login="Jihwan_Kim" class="lia-mention lia-mention-user"&gt;Jihwan_Kim&lt;/a&gt;&amp;nbsp;please help!!!&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 16:27:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-compute-measures-based-on-multiple-table-and-conditions/m-p/2511135#M69653</guid>
      <dc:creator>p_rathinavel</dc:creator>
      <dc:date>2022-05-12T16:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to compute measures based on multiple table and conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-compute-measures-based-on-multiple-table-and-conditions/m-p/2511214#M69657</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="299927" data-lia-user-login="p_rathinavel" class="lia-mention lia-mention-user"&gt;p_rathinavel&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;by "many incentive type" do you mean Incentive 1, Incentive 2, Incentive 3, etc. ?&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 16:59:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-compute-measures-based-on-multiple-table-and-conditions/m-p/2511214#M69657</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-05-12T16:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to compute measures based on multiple table and conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-compute-measures-based-on-multiple-table-and-conditions/m-p/2511289#M69662</link>
      <description>&lt;P&gt;Hello:&lt;/P&gt;&lt;P&gt;I was wondering if your table two is basically the same as the results you want?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are you calculating out commisions paid of you just want a list of the commision programs by agent?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe showing some more data on the results table?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 17:25:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-compute-measures-based-on-multiple-table-and-conditions/m-p/2511289#M69662</guid>
      <dc:creator>Whitewater100</dc:creator>
      <dc:date>2022-05-12T17:25:22Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to compute measures based on multiple table and conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-compute-measures-based-on-multiple-table-and-conditions/m-p/2511491#M69674</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, but the table 2 consists of the rate and not the actual amount. Also, you're right. It's basically the comissions paid of.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find the below images and do the needful&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks !!&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 19:16:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-compute-measures-based-on-multiple-table-and-conditions/m-p/2511491#M69674</guid>
      <dc:creator>p_rathinavel</dc:creator>
      <dc:date>2022-05-12T19:16:31Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to compute measures based on multiple table and conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-compute-measures-based-on-multiple-table-and-conditions/m-p/2513832#M69802</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="299927" data-lia-user-login="p_rathinavel" class="lia-mention lia-mention-user"&gt;p_rathinavel&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;One simple solution could be using nested iterators (SUMX). I hope the performance won't be an issue.&lt;/P&gt;&lt;P&gt;Here is a sample file&amp;nbsp;&lt;A href="https://we.tl/t-m74sXU2n70" target="_blank"&gt;https://we.tl/t-m74sXU2n70&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Incentive Amount = 
SUMX (
    TABLE1,
    SUMX (
        TABLE2,
        VAR Amount = TABLE1[AMOUNT]
        VAR MaxSales = TABLE2[MAXIMUM SALES]
        VAR MinSales = TABLE2[MINIMUM SALES]
        VAR Incentive1 = TABLE2[INCINTIVE 1]
        VAR Incentive2 = TABLE2[INCINTIVE 2]
        VAR Incentive3 = TABLE2[INCINTIVE 3]
        RETURN
            IF ( 
                Amount &amp;gt;= MinSales &amp;amp;&amp;amp; Amount &amp;lt;= MaxSales,
                Amount * ( Incentive1 + Incentive2 + Incentive3 ) / 100
            )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 14:42:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-compute-measures-based-on-multiple-table-and-conditions/m-p/2513832#M69802</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-05-13T14:42:55Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to compute measures based on multiple table and conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-compute-measures-based-on-multiple-table-and-conditions/m-p/2513854#M69804</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="299927" data-lia-user-login="p_rathinavel" class="lia-mention lia-mention-user"&gt;p_rathinavel&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Correction for the total&amp;nbsp;&lt;A href="https://we.tl/t-JtyRxx3uz7" target="_blank"&gt;https://we.tl/t-JtyRxx3uz7&lt;/A&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Incentive Amount = 
SUMX ( 
    SUMMARIZE ( TABLE2, TABLE2[AGENT CODE],TABLE2[INCENTIVE TYPE] ),
    CALCULATE ( 
        SUMX (
            TABLE2,
            SUMX (
                TABLE1,
                VAR Amount = TABLE1[AMOUNT]
                VAR MaxSales = TABLE2[MAXIMUM SALES]
                VAR MinSales = TABLE2[MINIMUM SALES]
                VAR Incentive1 = TABLE2[INCINTIVE 1]
                VAR Incentive2 = TABLE2[INCINTIVE 2]
                VAR Incentive3 = TABLE2[INCINTIVE 3]
                RETURN
                    IF ( 
                        Amount &amp;gt;= MinSales &amp;amp;&amp;amp; Amount &amp;lt;= MaxSales,
                        Amount * ( Incentive1 + Incentive2 + Incentive3 ) / 100
                    )
            )
        )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 14:55:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-compute-measures-based-on-multiple-table-and-conditions/m-p/2513854#M69804</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-05-13T14:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to compute measures based on multiple table and conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-compute-measures-based-on-multiple-table-and-conditions/m-p/2513918#M69810</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="317289" data-lia-user-login="tamerj1" class="lia-mention lia-mention-user"&gt;tamerj1&lt;/a&gt;&amp;nbsp;Thank you very much !! You're the real champion, it worked well for me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But the result is slightly inacurate, i.e. agent A has no incentive 1 and incentive 3 but the incentive 3 value is 0 and the final result should be 0.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And, in the result table it shows 0.15. could you please clarify it for me? thanks&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 15:25:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-compute-measures-based-on-multiple-table-and-conditions/m-p/2513918#M69810</guid>
      <dc:creator>p_rathinavel</dc:creator>
      <dc:date>2022-05-13T15:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: DAX to compute measures based on multiple table and conditions</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-compute-measures-based-on-multiple-table-and-conditions/m-p/2514037#M69819</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="299927" data-lia-user-login="p_rathinavel" class="lia-mention lia-mention-user"&gt;p_rathinavel&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But it has Incentive 2. The code basically sums the the 3 incentives (1, 2 &amp;amp; 3) but the table slices by incentive type. This is how I assumed as I could not think of any other logic. Please advise if I am wrong and let me what is right.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 May 2022 16:08:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-to-compute-measures-based-on-multiple-table-and-conditions/m-p/2514037#M69819</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-05-13T16:08:24Z</dc:date>
    </item>
  </channel>
</rss>

