<?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 Custom Column using an IF Statement based on two columns in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Custom-Column-using-an-IF-Statement-based-on-two-columns/m-p/4007622#M156994</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;how would i exclude weekends in this formulation?&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="625922" data-lia-user-login="bhanu_gautam" class="lia-mention lia-mention-user"&gt;bhanu_gautam&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Mon, 24 Jun 2024 19:06:11 GMT</pubDate>
    <dc:creator>Craig_01</dc:creator>
    <dc:date>2024-06-24T19:06:11Z</dc:date>
    <item>
      <title>Create Custom Column using an IF Statement based on two columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Custom-Column-using-an-IF-Statement-based-on-two-columns/m-p/3999849#M155746</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a dataset, that contains numerous columns of data, but main ones are:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Columns:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Branch&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Status&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Despatch Date&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Requested Date&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Promised Date&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to calculate the difference in days between the Despatch Date &amp;amp; the advised date.. So the logic needs to be like below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If &lt;STRONG&gt;Branch&lt;/STRONG&gt;="York" &amp;amp; &lt;STRONG&gt;Status&lt;/STRONG&gt; = "Out" (so i need both these to be satasified before it determins the true/false.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If True =&amp;nbsp; Despatch Date.Days - Requested Date.Days&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If False = Despatch Date.Days - Promised Date.Days&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any assistance would be apprecaited.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jun 2024 09:22:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Custom-Column-using-an-IF-Statement-based-on-two-columns/m-p/3999849#M155746</guid>
      <dc:creator>Craig_01</dc:creator>
      <dc:date>2024-06-19T09:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: Create Custom Column using an IF Statement based on two columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Custom-Column-using-an-IF-Statement-based-on-two-columns/m-p/3999967#M155757</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="643332" data-lia-user-login="Craig_01" class="lia-mention lia-mention-user"&gt;Craig_01&lt;/a&gt;&amp;nbsp;, Try using below formula for new calculated column&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;Difference = 
IF('Table'[Branch] = "York" &amp;amp;&amp;amp; 'Table'[Status] = "Out",
    DATEDIFF('Table'[Despatch Date], 'Table'[Requested Date], DAY),
    DATEDIFF('Table'[Despatch Date], 'Table'[Promised Date], DAY)
)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Jun 2024 10:46:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Custom-Column-using-an-IF-Statement-based-on-two-columns/m-p/3999967#M155757</guid>
      <dc:creator>bhanu_gautam</dc:creator>
      <dc:date>2024-06-19T10:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: Create Custom Column using an IF Statement based on two columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Custom-Column-using-an-IF-Statement-based-on-two-columns/m-p/4003561#M156188</link>
      <description>&lt;P&gt;Thanks for the reply from &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="625922" data-lia-user-login="bhanu_gautam" class="lia-mention lia-mention-user"&gt;bhanu_gautam&lt;/a&gt;&amp;nbsp;, please allow me to provide another insight:&amp;nbsp;&lt;BR /&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="643332" data-lia-user-login="Craig_01" class="lia-mention lia-mention-user"&gt;Craig_01&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Add Column – Custom Column.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;2. Enter code.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;if [Branch]="Your" and [Status] ="Out"
then Duration.Days([Despatch Date] - [Requested Date])
else Duration.Days([Despatch Date] - [Promised Date])&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;3. Result:&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;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2024 07:55:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Custom-Column-using-an-IF-Statement-based-on-two-columns/m-p/4003561#M156188</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-21T07:55:05Z</dc:date>
    </item>
    <item>
      <title>Re: Create Custom Column using an IF Statement based on two columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Custom-Column-using-an-IF-Statement-based-on-two-columns/m-p/4003890#M156235</link>
      <description>&lt;P&gt;Thanks, how to i exclude any Errors, where there is no data to calculate becasue of potentially columns that are only caputring data from 2024, and not in 2023 for example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2024 10:42:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Custom-Column-using-an-IF-Statement-based-on-two-columns/m-p/4003890#M156235</guid>
      <dc:creator>Craig_01</dc:creator>
      <dc:date>2024-06-21T10:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: Create Custom Column using an IF Statement based on two columns</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Custom-Column-using-an-IF-Statement-based-on-two-columns/m-p/4007622#M156994</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;how would i exclude weekends in this formulation?&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="625922" data-lia-user-login="bhanu_gautam" class="lia-mention lia-mention-user"&gt;bhanu_gautam&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2024 19:06:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Custom-Column-using-an-IF-Statement-based-on-two-columns/m-p/4007622#M156994</guid>
      <dc:creator>Craig_01</dc:creator>
      <dc:date>2024-06-24T19:06:11Z</dc:date>
    </item>
  </channel>
</rss>

