<?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: Find last Saturday of previous month and last friday of current month end in given Date table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-last-Saturday-of-previous-month-and-last-friday-of-current/m-p/3983097#M154434</link>
    <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="755571" data-lia-user-login="kkanukurthi" class="lia-mention lia-mention-user"&gt;kkanukurthi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Based on my testing, please &lt;SPAN&gt;try the following methods:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1.Create the simple table.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2.Create the new column to find the last Friday current month.&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;last friday current month = 
CALCULATE(
    MAX('Table'[Date]), 
    FILTER(
        'Table', 
        MONTH('Table'[Date]) = 
        MONTH(EARLIER('Table'[Date])) 
        &amp;amp;&amp;amp; YEAR('Table'[Date]) = YEAR(EARLIER('Table'[Date])) &amp;amp;&amp;amp;
        'Table'[weekday] = 5
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;3.Create the new column to find the last Saturday previous month.&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;last saturday previous month = 
var last_mon = 'Table'[Date]
var last_year = CALCULATE(
    MAX('Table'[Date]), 
    FILTER(
        'Table', 
        MONTH('Table'[Date]) = 
        MONTH(last_mon) - 1
        &amp;amp;&amp;amp; YEAR('Table'[Date]) = YEAR(last_mon) &amp;amp;&amp;amp;
        'Table'[weekday] = 6
    )
)
var last_12 = 
CALCULATE(
    MAX('Table'[Date]), 
    FILTER(
        'Table', 
        MONTH('Table'[Date]) = 12
        &amp;amp;&amp;amp; YEAR('Table'[Date]) = YEAR(last_mon) - 1 &amp;amp;&amp;amp;
        'Table'[weekday] = 6
    )
)
RETURN
IF(MONTH('Table'[Date]) = 1, last_12, last_year)
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;4.The result is shown below.&lt;/SPAN&gt;&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;Wisdom Wu&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 10 Jun 2024 09:02:11 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-06-10T09:02:11Z</dc:date>
    <item>
      <title>Find last Saturday of previous month and last friday of current month end in given Date table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-last-Saturday-of-previous-month-and-last-friday-of-current/m-p/3980063#M154312</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;Thanks for the solution for my latest post .&lt;A href="https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-last-Saturday-of-previous-month-and-last-friday-of-current/m-p/3958935" target="_blank"&gt;https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-last-Saturday-of-previous-month-and-last-friday-of-current/m-p/3958935&lt;/A&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;It works perfect for me. Above solution is for dates between CALENDAR("4/1/2024", "8/31/2024"). I mean it is comparing Month(Today()).&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Can you please help me with Dax code for dates between 01/01/2023 to 31/12/2025. I need for past and future dates please.&lt;/DIV&gt;&lt;DIV&gt;What is the slight modification that I need&amp;nbsp;to do in Dax code?&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;Thanks in Advance&lt;/DIV&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>Fri, 07 Jun 2024 13:48:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-last-Saturday-of-previous-month-and-last-friday-of-current/m-p/3980063#M154312</guid>
      <dc:creator>kkanukurthi</dc:creator>
      <dc:date>2024-06-07T13:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: Find last Saturday of previous month and last friday of current month end in given Date table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-last-Saturday-of-previous-month-and-last-friday-of-current/m-p/3983097#M154434</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="755571" data-lia-user-login="kkanukurthi" class="lia-mention lia-mention-user"&gt;kkanukurthi&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Based on my testing, please &lt;SPAN&gt;try the following methods:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1.Create the simple table.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;2.Create the new column to find the last Friday current month.&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;last friday current month = 
CALCULATE(
    MAX('Table'[Date]), 
    FILTER(
        'Table', 
        MONTH('Table'[Date]) = 
        MONTH(EARLIER('Table'[Date])) 
        &amp;amp;&amp;amp; YEAR('Table'[Date]) = YEAR(EARLIER('Table'[Date])) &amp;amp;&amp;amp;
        'Table'[weekday] = 5
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;3.Create the new column to find the last Saturday previous month.&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;last saturday previous month = 
var last_mon = 'Table'[Date]
var last_year = CALCULATE(
    MAX('Table'[Date]), 
    FILTER(
        'Table', 
        MONTH('Table'[Date]) = 
        MONTH(last_mon) - 1
        &amp;amp;&amp;amp; YEAR('Table'[Date]) = YEAR(last_mon) &amp;amp;&amp;amp;
        'Table'[weekday] = 6
    )
)
var last_12 = 
CALCULATE(
    MAX('Table'[Date]), 
    FILTER(
        'Table', 
        MONTH('Table'[Date]) = 12
        &amp;amp;&amp;amp; YEAR('Table'[Date]) = YEAR(last_mon) - 1 &amp;amp;&amp;amp;
        'Table'[weekday] = 6
    )
)
RETURN
IF(MONTH('Table'[Date]) = 1, last_12, last_year)
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;4.The result is shown below.&lt;/SPAN&gt;&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;Wisdom Wu&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2024 09:02:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Find-last-Saturday-of-previous-month-and-last-friday-of-current/m-p/3983097#M154434</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-10T09:02:11Z</dc:date>
    </item>
  </channel>
</rss>

