Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi,
Requirement: Set a Slicer that only shows second and fourth Saturday dates in all months of the year.
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).
I have a table and date column in it.
Please help me find a solution to this requirement.
Thanks heaps in advance.
Hi,
TO make it simple, I think the below requirement is enough.
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.
I have a date table mapped to my table date column.
So the filter will be using the date table, Date column.
In the table, I will be using Date column of my table.
Hope it makes sense. Pleaselet me know if more information needed. Thanks heaps guys
Hi @Pker_Tank , hello Kedar_Pande and 123abc , thank you for your prompt reply!
Based on your description, check the following measure:
IsInDateRangeMeasure =
VAR SelectedEndDate = SELECTEDVALUE('Date'[Date],MAX('Date'[Date]))
VAR StartDate = SelectedEndDate - 13
RETURN
IF(
MAX('Table'[DateColumn]) >= StartDate && MAX('Table'[DateColumn]) <= SelectedEndDate,
1,
0
)
Then filter the table data as shown below:
Best regards,
Joyce
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
TO make it simple, I think the below requirement is enough.
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.
I have a date table mapped to my table date column.
So the filter will be using the date table, Date column.
In the table, I will be using Date column of my table.
Hope it makes sense. Pleaselet me know if more information needed. Thanks heaps guys
Hi,
To make it simpler
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.
I have a date table mapped to my table date column.
Create a calculated column
Second_Fourth_Saturday =
VAR SelectedDate = 'YourTable'[Date]
VAR DayOfWeek = WEEKDAY(SelectedDate, 2)
VAR DayOfMonth = DAY(SelectedDate)
VAR WeekNumber = WEEKNUM(SelectedDate, 2)
RETURN
IF(
(DayOfWeek = 6 && WeekNumber = 2) || (DayOfWeek = 6 && WeekNumber = 4),
1,
0
)
In the slicer, use Second_Fourth_Saturday to filter only rows with the value 1 (second or fourth Saturdays).
Create a measure
Data_Upto_SelectedSaturday =
VAR SelectedSaturday = MAX('YourTable'[Date])
VAR FirstDayOfMonth = DATE(YEAR(SelectedSaturday), MONTH(SelectedSaturday), 1)
RETURN
CALCULATE(
SUM('YourTable'[YourDataColumn]),
'YourTable'[Date] >= FirstDayOfMonth && 'YourTable'[Date] <= SelectedSaturday
)
You can follow these steps:
Create a Date Table:
DateTable = CALENDAR(DATE(2024, 1, 1), DATE(2024, 12, 31))
Add Columns for Second and Fourth Saturdays:
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)
Create a Slicer:
Create a Measure for the Last 14 Days:
Last14DaysData = VAR SelectedDate = MAX('DateTable'[Date]) RETURN CALCULATE( SUM('YourDataTable'[YourDataColumn]), FILTER( 'YourDataTable', 'YourDataTable'[Date] >= SelectedDate - 13 && 'YourDataTable'[Date] <= SelectedDate ) )
Visualize the Data:
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.
Let me know if you need any further assistance!
Hi @123abc Thanks for your suggestion.
One quick change, In the second Saturday logic, I need the below dates.
May 11, May 25, June 8, June 22, July 6, July 20, Aug 3 ect. it's every 2 weeks.
How can I achieve that? Thanks