<?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: Create a column that returns value of another column while keeping the original value if no matches in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-column-that-returns-value-of-another-column-while/m-p/3801646#M148639</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure how your semantic model looks like but I tried to create a sample pbix file like below.&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbix file.&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;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;# customers at investment: =
CALCULATE ( SUM ( data[#_customers_start_of_year] ), 'year'[year] = 2022 )
&lt;/LI-CODE&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, 01 Apr 2024 08:24:23 GMT</pubDate>
    <dc:creator>Jihwan_Kim</dc:creator>
    <dc:date>2024-04-01T08:24:23Z</dc:date>
    <item>
      <title>Create a column that returns value of another column while keeping the original value if no matches</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-column-that-returns-value-of-another-column-while/m-p/3801602#M148636</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm completely new to PowerBI and have been exploring posts on the community board, but I can't seem to find a solution to my query and I really need help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table with 3 companies ranging across year 2022 and year 2023.&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;I am trying to insert a new column called 'No. of customers at investment', which is actually the number of customers at start of year for 2022:&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;How do I create a column that would return the value of 'No. of customers at start of year' for year 2022, regardless of whether the 'Year' column is 2022 or 2023?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks in advance!&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Apr 2024 08:04:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-column-that-returns-value-of-another-column-while/m-p/3801602#M148636</guid>
      <dc:creator>ESG</dc:creator>
      <dc:date>2024-04-01T08:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: Create a column that returns value of another column while keeping the original value if no matches</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-column-that-returns-value-of-another-column-while/m-p/3801646#M148639</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure how your semantic model looks like but I tried to create a sample pbix file like below.&lt;/P&gt;
&lt;P&gt;Please check the below picture and the attached pbix file.&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;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;# customers at investment: =
CALCULATE ( SUM ( data[#_customers_start_of_year] ), 'year'[year] = 2022 )
&lt;/LI-CODE&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, 01 Apr 2024 08:24:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-column-that-returns-value-of-another-column-while/m-p/3801646#M148639</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2024-04-01T08:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: Create a column that returns value of another column while keeping the original value if no matches</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-column-that-returns-value-of-another-column-while/m-p/3803340#M148704</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="715635" data-lia-user-login="ESG" class="lia-mention lia-mention-user"&gt;ESG&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Your solution is great, &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;. It works like charm! Here, I have another idea, I want to share it for reference. I used the calculation column instead of Measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Investment =
CALCULATE (Max ('Table' [Start]), Filter (all ('table'), 'table' [year] = 2022 &amp;amp;&amp;amp; 'table' [company name] = Earlier ('table' [company name]))&lt;/LI-CODE&gt;
&lt;P&gt;The final result is shown in the figure below.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;If your Current Period does not refer to this, please clarify in a follow-up reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Clara Gong&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;</description>
      <pubDate>Tue, 02 Apr 2024 01:54:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-column-that-returns-value-of-another-column-while/m-p/3803340#M148704</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-02T01:54:31Z</dc:date>
    </item>
    <item>
      <title>Re: Create a column that returns value of another column while keeping the original value if no matches</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-column-that-returns-value-of-another-column-while/m-p/3803362#M148705</link>
      <description>&lt;P&gt;thank you very much&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;and&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;for your guidance!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2024 02:12:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-a-column-that-returns-value-of-another-column-while/m-p/3803362#M148705</guid>
      <dc:creator>ESG</dc:creator>
      <dc:date>2024-04-02T02:12:47Z</dc:date>
    </item>
  </channel>
</rss>

