<?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 Reference Previous Quarter in SWITCH or Nested IF statement in DAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Reference-Previous-Quarter-in-SWITCH-or-Nested-IF-statement-in/m-p/1409048#M26076</link>
    <description>&lt;P&gt;I have a list of items in a table and want to be able to reference a date in the table and insert a text value to say if that date is "Completed in Current Quarter" or "Completed in Previous Quarter".&lt;/P&gt;&lt;P&gt;I have got the first part to work as the first AND statement works fine, but the 2nd and Statement that contains "=PREVIOUSQUARTER" errors.&lt;/P&gt;&lt;P&gt;If anyone could show me where i am going wrong that would be great.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;#Completion_Title = SWITCH(TRUE(),
    AND([#Story_Close_Date]&amp;gt;STARTOFQUARTER(DevOps_All_User_Stories[#Current_Date].[Date]),[#Story_Close_Date]&amp;lt;&amp;gt;BLANK()),"Completed in Current Quarter",
    AND([#Story_Close_Date]=PREVIOUSQUARTER(DevOps_All_User_Stories[#Current_Date].[Date]),[#Story_Close_Date]&amp;lt;&amp;gt;BLANK()),"Completed in Previous Quarter"
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Oct 2020 08:35:19 GMT</pubDate>
    <dc:creator>CDSouthall</dc:creator>
    <dc:date>2020-10-02T08:35:19Z</dc:date>
    <item>
      <title>Reference Previous Quarter in SWITCH or Nested IF statement in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Reference-Previous-Quarter-in-SWITCH-or-Nested-IF-statement-in/m-p/1409048#M26076</link>
      <description>&lt;P&gt;I have a list of items in a table and want to be able to reference a date in the table and insert a text value to say if that date is "Completed in Current Quarter" or "Completed in Previous Quarter".&lt;/P&gt;&lt;P&gt;I have got the first part to work as the first AND statement works fine, but the 2nd and Statement that contains "=PREVIOUSQUARTER" errors.&lt;/P&gt;&lt;P&gt;If anyone could show me where i am going wrong that would be great.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;#Completion_Title = SWITCH(TRUE(),
    AND([#Story_Close_Date]&amp;gt;STARTOFQUARTER(DevOps_All_User_Stories[#Current_Date].[Date]),[#Story_Close_Date]&amp;lt;&amp;gt;BLANK()),"Completed in Current Quarter",
    AND([#Story_Close_Date]=PREVIOUSQUARTER(DevOps_All_User_Stories[#Current_Date].[Date]),[#Story_Close_Date]&amp;lt;&amp;gt;BLANK()),"Completed in Previous Quarter"
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2020 08:35:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Reference-Previous-Quarter-in-SWITCH-or-Nested-IF-statement-in/m-p/1409048#M26076</guid>
      <dc:creator>CDSouthall</dc:creator>
      <dc:date>2020-10-02T08:35:19Z</dc:date>
    </item>
    <item>
      <title>Re: Reference Previous Quarter in SWITCH or Nested IF statement in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Reference-Previous-Quarter-in-SWITCH-or-Nested-IF-statement-in/m-p/1409263#M26083</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="206833" data-lia-user-login="CDSouthall" class="lia-mention lia-mention-user"&gt;CDSouthall&lt;/a&gt; , PreviousQuarter is going to return set of dates &lt;/P&gt;
&lt;P&gt;Try in&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;#Completion_Title = SWITCH(TRUE(),
    AND([#Story_Close_Date]&amp;gt;STARTOFQUARTER(DevOps_All_User_Stories[#Current_Date].[Date]),[#Story_Close_Date]&amp;lt;&amp;gt;BLANK()),"Completed in Current Quarter",
    AND([#Story_Close_Date] in PREVIOUSQUARTER(DevOps_All_User_Stories[#Current_Date].[Date]),[#Story_Close_Date]&amp;lt;&amp;gt;BLANK()),"Completed in Previous Quarter"
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;#Completion_Title = SWITCH(TRUE(),
    AND([#Story_Close_Date]&amp;gt;STARTOFQUARTER(DevOps_All_User_Stories[#Current_Date].[Date]),[#Story_Close_Date]&amp;lt;&amp;gt;BLANK()),"Completed in Current Quarter",
    AND([#Story_Close_Date]=minx(DevOps_All_User_Stories,PREVIOUSQUARTER(DevOps_All_User_Stories[#Current_Date].[Date])),[#Story_Close_Date]&amp;lt;&amp;gt;BLANK()),"Completed in Previous Quarter"
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ideally, you should use date table for time intelligence and should not use .date. Unless date has a timestamp.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer : &lt;BR /&gt;&lt;A href="https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions" target="_blank"&gt;https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions&lt;/A&gt; &lt;BR /&gt;&lt;A href="https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi" target="_blank"&gt;https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Appreciate your Kudos.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2020 10:05:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Reference-Previous-Quarter-in-SWITCH-or-Nested-IF-statement-in/m-p/1409263#M26083</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2020-10-02T10:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Reference Previous Quarter in SWITCH or Nested IF statement in DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Reference-Previous-Quarter-in-SWITCH-or-Nested-IF-statement-in/m-p/1412555#M26186</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks indeed for your assistance on this, the first one worked great, so provided the answer i was looking for, many thanks again &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;PRE&gt;#Completion_Title = SWITCH(TRUE(),
    AND([#Story_Close_Date]&amp;gt;STARTOFQUARTER(DevOps_All_User_Stories[#Current_Date].[Date]),[#Story_Close_Date]&amp;lt;&amp;gt;BLANK()),"Completed in Current Quarter",
    AND([#Story_Close_Date] in PREVIOUSQUARTER(DevOps_All_User_Stories[#Current_Date].[Date]),[#Story_Close_Date]&amp;lt;&amp;gt;BLANK()),"Completed in Previous Quarter"
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2020 08:22:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Reference-Previous-Quarter-in-SWITCH-or-Nested-IF-statement-in/m-p/1412555#M26186</guid>
      <dc:creator>CDSouthall</dc:creator>
      <dc:date>2020-10-05T08:22:55Z</dc:date>
    </item>
  </channel>
</rss>

