<?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 If and  statements between different tables in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-and-statements-between-different-tables/m-p/2833799#M90342</link>
    <description>&lt;P&gt;Hi im trying to based on 2 conditions from different tables give a decided value or else 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have tried to put in a custom column:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if([Besparelse] = 1 and (#"Kontoplan"[Mva Norge] =&amp;gt;0 then 0,25 else 0))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[Besparelse] = from primary table&lt;/P&gt;&lt;P&gt;Kontoplan = is the second table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Oct 2022 10:52:53 GMT</pubDate>
    <dc:creator>Da_clint</dc:creator>
    <dc:date>2022-10-11T10:52:53Z</dc:date>
    <item>
      <title>If and  statements between different tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-and-statements-between-different-tables/m-p/2833799#M90342</link>
      <description>&lt;P&gt;Hi im trying to based on 2 conditions from different tables give a decided value or else 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have tried to put in a custom column:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if([Besparelse] = 1 and (#"Kontoplan"[Mva Norge] =&amp;gt;0 then 0,25 else 0))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[Besparelse] = from primary table&lt;/P&gt;&lt;P&gt;Kontoplan = is the second table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2022 10:52:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-and-statements-between-different-tables/m-p/2833799#M90342</guid>
      <dc:creator>Da_clint</dc:creator>
      <dc:date>2022-10-11T10:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: If and  statements between different tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-and-statements-between-different-tables/m-p/2835455#M90468</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="454644" data-lia-user-login="Da_clint" class="lia-mention lia-mention-user"&gt;Da_clint&lt;/a&gt; , In the power query you have to merge tables before you can write some condition across table, AFter merge, they are in a single table.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In DAX you can bring the column back into your table&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;refer 4 ways to copy data from one table to another&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=Wu1mWxR23jU" target="_blank"&gt;https://www.youtube.com/watch?v=Wu1mWxR23jU&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.youtube.com/watch?v=czNHt7UXIe8" target="_blank"&gt;https://www.youtube.com/watch?v=czNHt7UXIe8&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 02:47:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-and-statements-between-different-tables/m-p/2835455#M90468</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-10-12T02:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: If and  statements between different tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-and-statements-between-different-tables/m-p/2835920#M90491</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="454644" data-lia-user-login="Da_clint" class="lia-mention lia-mention-user"&gt;Da_clint&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here I create a sample to have a test.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Kontoplan:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Primary:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Custom column:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;if [Besparelse] = 1 and 
List.Sum(
let 
_Customer = [Customer]
in
Table.SelectRows(Kontoplan, each [Customer] = _Customer)
[Mva Norge]) &amp;gt;= 0 then 0.25 else 0&lt;/LI-CODE&gt;
&lt;P&gt;Here I add this custom column into Primary table. Result is as below.&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;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 07:12:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-and-statements-between-different-tables/m-p/2835920#M90491</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-10-12T07:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: If and  statements between different tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-and-statements-between-different-tables/m-p/2838404#M90639</link>
      <description>&lt;P&gt;Thank you Rico&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I see that this probably also will work, but I solved it by bringing in the data to the same table &amp;amp; then use a IF &amp;amp;&amp;amp; function in DAX&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2022 05:27:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/If-and-statements-between-different-tables/m-p/2838404#M90639</guid>
      <dc:creator>Da_clint</dc:creator>
      <dc:date>2022-10-13T05:27:34Z</dc:date>
    </item>
  </channel>
</rss>

