<?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: IF statement with custom dates in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-statement-with-custom-dates/m-p/1277404#M21670</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="251189" data-lia-user-login="Jackbaz99" class="lia-mention lia-mention-user"&gt;Jackbaz99&lt;/a&gt;&amp;nbsp;- So your formula should be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = IF('Customer DSA'[Due Date].[Date] &amp;lt;= DATE(2019,1,1) &amp;amp;&amp;amp; 'Customer DSA'[Due Date].[Date] &amp;gt;= DATE(2019,9,1),0,1)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That said, instead of nested IF statements, try using SWITCH(TRUE()...) instead. Much better than nested IF statements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you are new, please first check if your issue is a common issue listed here: &lt;A href="https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also, please see this post regarding How to Get Your Question Answered Quickly: &lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The most important parts are:&lt;BR /&gt;1. Sample data as text, use the table tool in the editing bar&lt;BR /&gt;2. Expected output from sample data&lt;BR /&gt;3. Explanation in words of how to get from 1. to 2.&lt;/P&gt;</description>
    <pubDate>Thu, 06 Aug 2020 12:27:59 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2020-08-06T12:27:59Z</dc:date>
    <item>
      <title>IF statement with custom dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-statement-with-custom-dates/m-p/1277385#M21669</link>
      <description>&lt;P&gt;Hi all, my first post here so apologies if this is somewhere else but i cannot find ANYTHING to do with this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Im trying to do a nested if statement with custom dates returning different values - the scenario is if the customer due date falls between for example 01/01/2019 and 01/09/2019 then the target is 0.75 if it falls between 02/09/2019 and 01/12/2019 then the target is 0.80 and so on so forth. im stuch below - dont think im too far away&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I am getting a true/false data type with dates error.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;Any help would be appreciated&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Column = IF('Customer DSA'[Due Date].[Date] &amp;lt;= DATE(2019,1,1) &amp;gt;= DATE(2019,9,1),0,1)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 12:17:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-statement-with-custom-dates/m-p/1277385#M21669</guid>
      <dc:creator>Jackbaz99</dc:creator>
      <dc:date>2020-08-06T12:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement with custom dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-statement-with-custom-dates/m-p/1277404#M21670</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="251189" data-lia-user-login="Jackbaz99" class="lia-mention lia-mention-user"&gt;Jackbaz99&lt;/a&gt;&amp;nbsp;- So your formula should be:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = IF('Customer DSA'[Due Date].[Date] &amp;lt;= DATE(2019,1,1) &amp;amp;&amp;amp; 'Customer DSA'[Due Date].[Date] &amp;gt;= DATE(2019,9,1),0,1)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That said, instead of nested IF statements, try using SWITCH(TRUE()...) instead. Much better than nested IF statements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since you are new, please first check if your issue is a common issue listed here: &lt;A href="https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also, please see this post regarding How to Get Your Question Answered Quickly: &lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The most important parts are:&lt;BR /&gt;1. Sample data as text, use the table tool in the editing bar&lt;BR /&gt;2. Expected output from sample data&lt;BR /&gt;3. Explanation in words of how to get from 1. to 2.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 12:27:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-statement-with-custom-dates/m-p/1277404#M21670</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-08-06T12:27:59Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement with custom dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-statement-with-custom-dates/m-p/1277456#M21675</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="251189" data-lia-user-login="Jackbaz99" class="lia-mention lia-mention-user"&gt;Jackbaz99&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apart from the above mentioned solution, you can use SWITCH&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Column =
SWITCH (
    TRUE (),
    'Customer DSA'[Due Date].[Date]
        &amp;lt;= DATE ( 2019, 1, 1 )
        &amp;amp;&amp;amp; 'Customer DSA'[Due Date].[Date]
            &amp;gt;= DATE ( 2019, 9, 1 ), 0.75,
    'Customer DSA'[Due Date].[Date]
        &amp;lt;= DATE ( 2019, 9, 2 )
        &amp;amp;&amp;amp; 'Customer DSA'[Due Date].[Date]
            &amp;gt;= DATE ( 2019, 12, 1 ), 0.80
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Harsh Nathani&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 12:54:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-statement-with-custom-dates/m-p/1277456#M21675</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-06T12:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement with custom dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-statement-with-custom-dates/m-p/1277463#M21677</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp; Thank you both! The switch function is a godsend&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt; much appreciated!&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 13:05:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-statement-with-custom-dates/m-p/1277463#M21677</guid>
      <dc:creator>Jackbaz99</dc:creator>
      <dc:date>2020-08-06T13:05:13Z</dc:date>
    </item>
    <item>
      <title>Re: IF statement with custom dates</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-statement-with-custom-dates/m-p/1277590#M21688</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Im not getting any return for this function. Just blanks.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Aug 2020 13:51:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/IF-statement-with-custom-dates/m-p/1277590#M21688</guid>
      <dc:creator>Jackbaz99</dc:creator>
      <dc:date>2020-08-06T13:51:27Z</dc:date>
    </item>
  </channel>
</rss>

