<?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: Conditional Column using IF statement comparing two different columns in two tables in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Column-using-IF-statement-comparing-two-different/m-p/2148590#M49474</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="333670" data-lia-user-login="jgiolli" class="lia-mention lia-mention-user"&gt;jgiolli&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Verify that you have one row per project.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://dax.guide/lookupvalue/" target="_self"&gt;https://dax.guide/lookupvalue/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;SPAN style="caret-color: #333333; color: #333333; font-family: Roboto, sans-serif; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration: none; display: inline !important; float: none;"&gt;If multiple rows match the search values and in all cases Result_Column values are identical then that value is returned. However, if Result_Column returns different values an error is returned.&lt;/SPAN&gt;"&lt;/P&gt;</description>
    <pubDate>Thu, 21 Oct 2021 15:37:12 GMT</pubDate>
    <dc:creator>DataInsights</dc:creator>
    <dc:date>2021-10-21T15:37:12Z</dc:date>
    <item>
      <title>Conditional Column using IF statement comparing two different columns in two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Column-using-IF-statement-comparing-two-different/m-p/2145876#M49379</link>
      <description>&lt;P&gt;I am trying to compare two columns which include revenue from two different tables.&amp;nbsp; Column 1 is project amount and it would contain revenue for projects from our CRM tables.&amp;nbsp; Column 2 is revenue from our ERP system tables.&amp;nbsp; What I'd like to do is look at Column 2 and for any values that are 0, I'd like to replace that with what is in column 1 in the CRM table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried doing this in measures but the subtotals would not work properly so believe I need a custom column or conditional column.&amp;nbsp; This is the formula I used for the measure.&amp;nbsp; Any help would be greatly appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;sum&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;PA01201[PARetainer_Fee_Amount]&lt;/SPAN&gt;&lt;SPAN&gt;)= &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;sum&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;New_Project[New_revenue]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;sum&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;PA01201[PARetainer_Fee_Amount]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 20 Oct 2021 14:07:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Column-using-IF-statement-comparing-two-different/m-p/2145876#M49379</guid>
      <dc:creator>jgiolli</dc:creator>
      <dc:date>2021-10-20T14:07:18Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Column using IF statement comparing two different columns in two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Column-using-IF-statement-comparing-two-different/m-p/2148338#M49462</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="333670" data-lia-user-login="jgiolli" class="lia-mention lia-mention-user"&gt;jgiolli&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this calculated column in the ERP table PA01201. It performs a lookup using Date.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;New_revenue = 
VAR vAmountERP = PA01201[PARetainer_Fee_Amount]
VAR vAmountCRM =
    LOOKUPVALUE ( New_Project[New_revenue], New_Project[Date], PA01201[Date] )
VAR vResult =
    IF ( vAmountERP = 0, vAmountCRM, vAmountERP )
RETURN
    vResult&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;CRM table New_Project:&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;ERP table PA01201:&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;</description>
      <pubDate>Thu, 21 Oct 2021 14:02:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Column-using-IF-statement-comparing-two-different/m-p/2148338#M49462</guid>
      <dc:creator>DataInsights</dc:creator>
      <dc:date>2021-10-21T14:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Column using IF statement comparing two different columns in two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Column-using-IF-statement-comparing-two-different/m-p/2148417#M49465</link>
      <description>&lt;P&gt;Its saying that LOOKUPVALUE is not a function and as a result its not letting me lookup a field. Also, instead of date we want to compare based on New_Project[Project_Number].&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Oct 2021 14:27:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Column-using-IF-statement-comparing-two-different/m-p/2148417#M49465</guid>
      <dc:creator>jgiolli</dc:creator>
      <dc:date>2021-10-21T14:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Column using IF statement comparing two different columns in two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Column-using-IF-statement-comparing-two-different/m-p/2148469#M49467</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="333670" data-lia-user-login="jgiolli" class="lia-mention lia-mention-user"&gt;jgiolli&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you creating a calculated column? LOOKUPVALUE should be available.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To lookup on a different column, simply replace Date with Project_Number:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;LOOKUPVALUE ( New_Project[New_revenue], New_Project[Project_Number], PA01201[Project_Number] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Oct 2021 14:48:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Column-using-IF-statement-comparing-two-different/m-p/2148469#M49467</guid>
      <dc:creator>DataInsights</dc:creator>
      <dc:date>2021-10-21T14:48:34Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Column using IF statement comparing two different columns in two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Column-using-IF-statement-comparing-two-different/m-p/2148523#M49470</link>
      <description>&lt;P&gt;I'm going into the field list under the table PA1201, selecting new column and adding the formula you provided.&amp;nbsp; Its saying LOOKUPVALUE is not a function.&amp;nbsp; Not sure if there is another place I should be doing creating this column.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Oct 2021 15:07:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Column-using-IF-statement-comparing-two-different/m-p/2148523#M49470</guid>
      <dc:creator>jgiolli</dc:creator>
      <dc:date>2021-10-21T15:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Column using IF statement comparing two different columns in two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Column-using-IF-statement-comparing-two-different/m-p/2148541#M49471</link>
      <description>&lt;P&gt;Could it be because I am in direct query mode?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Oct 2021 15:11:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Column-using-IF-statement-comparing-two-different/m-p/2148541#M49471</guid>
      <dc:creator>jgiolli</dc:creator>
      <dc:date>2021-10-21T15:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Column using IF statement comparing two different columns in two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Column-using-IF-statement-comparing-two-different/m-p/2148570#M49472</link>
      <description>&lt;P&gt;So good news is that this error was occuring because of the direct query which is now fixed.&amp;nbsp; However, now I'm getting a different error.&amp;nbsp; Here's the expression as entered:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;New_revenue = &lt;/SPAN&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;vAmountERP&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;PA01201[PARetainer_Fee_Amount]&lt;/SPAN&gt; &lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;vAmountCRM&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;LOOKUPVALUE&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;New_Project[New_revenue]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;New_Project[Project Number]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;PA01201[PAcontid]&lt;/SPAN&gt;&lt;SPAN&gt; ) &lt;/SPAN&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;vResult&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt; ( &lt;/SPAN&gt;&lt;SPAN&gt;vAmountERP&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;vAmountCRM&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;vAmountERP&lt;/SPAN&gt;&lt;SPAN&gt; ) &lt;/SPAN&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt; &lt;SPAN&gt;vResult&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The error says a table of multiple values was supplied where a single value was expected.&amp;nbsp; Any ideas on how to resolve?&amp;nbsp; Thanks for your help!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 21 Oct 2021 15:24:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Column-using-IF-statement-comparing-two-different/m-p/2148570#M49472</guid>
      <dc:creator>jgiolli</dc:creator>
      <dc:date>2021-10-21T15:24:39Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional Column using IF statement comparing two different columns in two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Column-using-IF-statement-comparing-two-different/m-p/2148590#M49474</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="333670" data-lia-user-login="jgiolli" class="lia-mention lia-mention-user"&gt;jgiolli&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Verify that you have one row per project.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://dax.guide/lookupvalue/" target="_self"&gt;https://dax.guide/lookupvalue/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&lt;SPAN style="caret-color: #333333; color: #333333; font-family: Roboto, sans-serif; font-size: 16px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: #ffffff; text-decoration: none; display: inline !important; float: none;"&gt;If multiple rows match the search values and in all cases Result_Column values are identical then that value is returned. However, if Result_Column returns different values an error is returned.&lt;/SPAN&gt;"&lt;/P&gt;</description>
      <pubDate>Thu, 21 Oct 2021 15:37:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-Column-using-IF-statement-comparing-two-different/m-p/2148590#M49474</guid>
      <dc:creator>DataInsights</dc:creator>
      <dc:date>2021-10-21T15:37:12Z</dc:date>
    </item>
  </channel>
</rss>

