March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi,
I would like to filter by relative date, but I need two conditions:
-is in the last 3 months
OR
- is in the next 9 months
The result must show a 12 month period (one quarter in the past, and 3 in the future.
From what I can see, the filter by relative date only allows choosing one. If I create 2 filters, it's an AND not an OR and it removes all results... Is there a way to do this please?
Solved! Go to Solution.
create a calculated column:
DateRangeFlag =
VAR CurrentDate = TODAY()
VAR PastStartDate = EDATE(CurrentDate, -3) // 3 months ago
VAR FutureEndDate = EDATE(CurrentDate, 9) // 9 months into the future
RETURN
IF(
'YourTable'[Date] >= PastStartDate && 'YourTable'[Date] <= CurrentDate ||
'YourTable'[Date] > CurrentDate && 'YourTable'[Date] <= FutureEndDate,
1,
0
)
Set the filter to show only where DateRangeFlag is equal to 1
💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn
create a calculated column:
DateRangeFlag =
VAR CurrentDate = TODAY()
VAR PastStartDate = EDATE(CurrentDate, -3) // 3 months ago
VAR FutureEndDate = EDATE(CurrentDate, 9) // 9 months into the future
RETURN
IF(
'YourTable'[Date] >= PastStartDate && 'YourTable'[Date] <= CurrentDate ||
'YourTable'[Date] > CurrentDate && 'YourTable'[Date] <= FutureEndDate,
1,
0
)
Set the filter to show only where DateRangeFlag is equal to 1
💌 If this helped, a Kudos 👍 or Solution mark would be great! 🎉
Cheers,
Kedar
Connect on LinkedIn
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
125 | |
85 | |
69 | |
54 | |
45 |
User | Count |
---|---|
204 | |
106 | |
98 | |
65 | |
54 |