<?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: How to get the last 14 days data when second saturday or fourth Saturday is selected in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-last-14-days-data-when-second-saturday-or-fourth/m-p/4343985#M172495</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;TO make it simple, I think the below requirement is enough.&lt;BR /&gt;If a user selects a date ending from the date filter (ex: 14 Dec) he should see the data from 1st Dec to 14th Dec.&lt;BR /&gt;I have a date table mapped to my table date column.&lt;BR /&gt;So the filter will be using the date table, Date column.&lt;BR /&gt;In the table, I will be using Date column of my table.&lt;BR /&gt;Hope it makes sense. Pleaselet me know if more information needed. Thanks heaps guys&lt;/P&gt;</description>
    <pubDate>Fri, 27 Dec 2024 00:50:33 GMT</pubDate>
    <dc:creator>Pker_Tank</dc:creator>
    <dc:date>2024-12-27T00:50:33Z</dc:date>
    <item>
      <title>How to get the last 14 days data when second saturday or fourth Saturday is selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-last-14-days-data-when-second-saturday-or-fourth/m-p/4343397#M172458</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Requirement: Set a Slicer that only shows second and fourth Saturday dates in all months of the year.&lt;/P&gt;&lt;P&gt;When selected, for example 14th Dec (which is the second Saturday of December), the user should be able to see the data from 1st Dec to 14th Dec (14 days).&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table and date column in it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me find a solution to this requirement.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks heaps in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Dec 2024 08:42:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-last-14-days-data-when-second-saturday-or-fourth/m-p/4343397#M172458</guid>
      <dc:creator>Pker_Tank</dc:creator>
      <dc:date>2024-12-26T08:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the last 14 days data when second saturday or fourth Saturday is selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-last-14-days-data-when-second-saturday-or-fourth/m-p/4343527#M172460</link>
      <description>&lt;P&gt;You can follow these steps:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Create a Date Table&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Ensure you have a Date table in your model. If not, you can create one using DAX:&lt;DIV class=""&gt;&lt;PRE&gt;DateTable = CALENDAR(DATE(2024, 1, 1), DATE(2024, 12, 31))&lt;/PRE&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Add Columns for Second and Fourth Saturdays&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Add calculated columns to identify second and fourth Saturdays:&lt;DIV class=""&gt;&lt;PRE&gt;SecondSaturday = 
VAR CurrentMonth = MONTH([Date])
VAR CurrentYear = YEAR([Date])
VAR FirstDayOfMonth = DATE(CurrentYear, CurrentMonth, 1)
VAR FirstSaturday = FirstDayOfMonth + (7 - WEEKDAY(FirstDayOfMonth, 2))
VAR SecondSaturday = FirstSaturday + 7
RETURN IF([Date] = SecondSaturday, 1, 0)

FourthSaturday = 
VAR CurrentMonth = MONTH([Date])
VAR CurrentYear = YEAR([Date])
VAR FirstDayOfMonth = DATE(CurrentYear, CurrentMonth, 1)
VAR FirstSaturday = FirstDayOfMonth + (7 - WEEKDAY(FirstDayOfMonth, 2))
VAR FourthSaturday = FirstSaturday + 21
RETURN IF([Date] = FourthSaturday, 1, 0)&lt;/PRE&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Create a Slicer&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Add a slicer to your report and use the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;SecondSaturday&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;FourthSaturday&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;columns to filter the dates.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Create a Measure for the Last 14 Days&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Create a measure to calculate the last 14 days of data when a second or fourth Saturday is selected:&lt;DIV class=""&gt;&lt;PRE&gt;Last14DaysData = 
VAR SelectedDate = MAX('DateTable'[Date])
RETURN CALCULATE(
    SUM('YourDataTable'[YourDataColumn]),
    FILTER(
        'YourDataTable',
        'YourDataTable'[Date] &amp;gt;= SelectedDate - 13 &amp;amp;&amp;amp;
        'YourDataTable'[Date] &amp;lt;= SelectedDate
    )
)&lt;/PRE&gt;&lt;/DIV&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Visualize the Data&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Use the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;Last14DaysData&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;measure in your visuals to display the data for the last 14 days based on the selected date.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;This setup will allow you to select the second or fourth Saturday from the slicer and view the data for the last 14 days up to the selected date.&lt;/P&gt;&lt;P&gt;Let me know if you need any further assistance!&lt;/P&gt;</description>
      <pubDate>Thu, 26 Dec 2024 10:06:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-last-14-days-data-when-second-saturday-or-fourth/m-p/4343527#M172460</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2024-12-26T10:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the last 14 days data when second saturday or fourth Saturday is selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-last-14-days-data-when-second-saturday-or-fourth/m-p/4343645#M172467</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="905657" data-lia-user-login="Pker_Tank" class="lia-mention lia-mention-user"&gt;Pker_Tank&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create a calculated column&lt;/P&gt;&lt;PRE&gt;Second_Fourth_Saturday = &lt;BR /&gt;VAR SelectedDate = 'YourTable'[Date]&lt;BR /&gt;VAR DayOfWeek = WEEKDAY(SelectedDate, 2)&amp;nbsp;&lt;BR /&gt;VAR DayOfMonth = DAY(SelectedDate)&lt;BR /&gt;VAR WeekNumber = WEEKNUM(SelectedDate, 2)&amp;nbsp;&lt;BR /&gt;RETURN &lt;BR /&gt;IF(&lt;BR /&gt;(DayOfWeek = 6 &amp;amp;&amp;amp; WeekNumber = 2) || (DayOfWeek = 6 &amp;amp;&amp;amp; WeekNumber = 4), &lt;BR /&gt;1, &lt;BR /&gt;0&lt;BR /&gt;)&lt;/PRE&gt;&lt;P&gt;In the slicer, use Second_Fourth_Saturday to filter only rows with the value 1 (second or fourth Saturdays).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create a measure&lt;/P&gt;&lt;PRE&gt;Data_Upto_SelectedSaturday = &lt;BR /&gt;VAR SelectedSaturday = MAX('YourTable'[Date])&lt;BR /&gt;VAR FirstDayOfMonth = DATE(YEAR(SelectedSaturday), MONTH(SelectedSaturday), 1)&lt;BR /&gt;RETURN&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM('YourTable'[YourDataColumn]),&lt;BR /&gt;'YourTable'[Date] &amp;gt;= FirstDayOfMonth &amp;amp;&amp;amp; 'YourTable'[Date] &amp;lt;= SelectedSaturday&lt;BR /&gt;)&lt;/PRE&gt;&lt;DIV&gt;&lt;span class="lia-unicode-emoji" title=":light_bulb:"&gt;💡&lt;/span&gt; &lt;STRONG&gt;If this helped, please give Kudos &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt; or mark it as a Solution &lt;span class="lia-unicode-emoji" title=":white_heavy_check_mark:"&gt;✅&lt;/span&gt;.&lt;/STRONG&gt;&lt;BR /&gt;&lt;EM&gt;Best regards,&lt;BR /&gt;&lt;STRONG&gt;Kedar&lt;/STRONG&gt;&lt;EM&gt;&lt;BR /&gt;&lt;A href="https://www.linkedin.com/in/kedar-pande" target="_blank"&gt;&lt;span class="lia-unicode-emoji" title=":globe_with_meridians:"&gt;🌐&lt;/span&gt; Connect on LinkedIn&lt;/A&gt;&lt;BR /&gt;&lt;/EM&gt;&lt;/EM&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 26 Dec 2024 12:31:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-last-14-days-data-when-second-saturday-or-fourth/m-p/4343645#M172467</guid>
      <dc:creator>Kedar_Pande</dc:creator>
      <dc:date>2024-12-26T12:31:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the last 14 days data when second saturday or fourth Saturday is selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-last-14-days-data-when-second-saturday-or-fourth/m-p/4343964#M172491</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="403667" data-lia-user-login="123abc" class="lia-mention lia-mention-user"&gt;123abc&lt;/a&gt;&amp;nbsp; Thanks for your suggestion.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;One quick change, In the second Saturday logic, I need the below dates.&lt;BR /&gt;May 11, May 25, June 8, June 22, July 6, July 20, Aug 3 ect. it's every 2 weeks.&lt;BR /&gt;How can I achieve that? Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 26 Dec 2024 23:36:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-last-14-days-data-when-second-saturday-or-fourth/m-p/4343964#M172491</guid>
      <dc:creator>Pker_Tank</dc:creator>
      <dc:date>2024-12-26T23:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the last 14 days data when second saturday or fourth Saturday is selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-last-14-days-data-when-second-saturday-or-fourth/m-p/4343983#M172494</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To make it simpler&lt;BR /&gt;&lt;BR /&gt;If a user selects a end date say 14 Dec in the flter, he should see the data 2 weeks back say 1 dec to 14 dec.&lt;BR /&gt;I have a date table mapped to my table date column.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2024 00:43:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-last-14-days-data-when-second-saturday-or-fourth/m-p/4343983#M172494</guid>
      <dc:creator>Pker_Tank</dc:creator>
      <dc:date>2024-12-27T00:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the last 14 days data when second saturday or fourth Saturday is selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-last-14-days-data-when-second-saturday-or-fourth/m-p/4343985#M172495</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;TO make it simple, I think the below requirement is enough.&lt;BR /&gt;If a user selects a date ending from the date filter (ex: 14 Dec) he should see the data from 1st Dec to 14th Dec.&lt;BR /&gt;I have a date table mapped to my table date column.&lt;BR /&gt;So the filter will be using the date table, Date column.&lt;BR /&gt;In the table, I will be using Date column of my table.&lt;BR /&gt;Hope it makes sense. Pleaselet me know if more information needed. Thanks heaps guys&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2024 00:50:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-last-14-days-data-when-second-saturday-or-fourth/m-p/4343985#M172495</guid>
      <dc:creator>Pker_Tank</dc:creator>
      <dc:date>2024-12-27T00:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the last 14 days data when second saturday or fourth Saturday is selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-last-14-days-data-when-second-saturday-or-fourth/m-p/4343986#M172496</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;BR /&gt;TO make it simple, I think the below requirement is enough.&lt;BR /&gt;If a user selects a date ending from the date filter (ex: 14 Dec) he should see the data from 1st Dec to 14th Dec.&lt;BR /&gt;I have a date table mapped to my table date column.&lt;BR /&gt;So the filter will be using the date table, Date column.&lt;BR /&gt;In the table, I will be using Date column of my table.&lt;BR /&gt;Hope it makes sense. Pleaselet me know if more information needed. Thanks heaps guys&lt;/P&gt;</description>
      <pubDate>Fri, 27 Dec 2024 00:50:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-last-14-days-data-when-second-saturday-or-fourth/m-p/4343986#M172496</guid>
      <dc:creator>Pker_Tank</dc:creator>
      <dc:date>2024-12-27T00:50:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the last 14 days data when second saturday or fourth Saturday is selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-last-14-days-data-when-second-saturday-or-fourth/m-p/4346054#M172595</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="905657" data-lia-user-login="Pker_Tank" class="lia-mention lia-mention-user"&gt;Pker_Tank&lt;/a&gt;&amp;nbsp;, hello&amp;nbsp;Kedar_Pande&amp;nbsp; and&amp;nbsp;123abc&amp;nbsp;, thank you for your prompt reply!&lt;BR /&gt;&lt;BR /&gt;Based on your description,&amp;nbsp; check the following measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;IsInDateRangeMeasure = 
VAR SelectedEndDate = SELECTEDVALUE('Date'[Date],MAX('Date'[Date]))
VAR StartDate = SelectedEndDate - 13  
RETURN
IF(
    MAX('Table'[DateColumn]) &amp;gt;= StartDate &amp;amp;&amp;amp; MAX('Table'[DateColumn]) &amp;lt;= SelectedEndDate,
    1,
    0
)&lt;/LI-CODE&gt;
&lt;P&gt;Then filter the table data as shown below:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best regards,&lt;/P&gt;
&lt;P&gt;Joyce&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2024 08:59:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-the-last-14-days-data-when-second-saturday-or-fourth/m-p/4346054#M172595</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-30T08:59:22Z</dc:date>
    </item>
  </channel>
</rss>

