Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

View all the Fabric Data Days sessions on demand. View schedule

Reply
Anonymous
Not applicable

Relative Date Filter: When the value 'is NOT in the last ...'

Hi all,

 

I'm looking for an elegant way of applying a relative date filter to my report that will filter out data from the last week (or so). The reason I want this, is because recent data is still vulnerable to changes and it's a requirement that my end-users will not see it, as it's not that reliable.

 

The relative date filter gives me the option to show items when the value 'is in the last ... days', but I'd rather need 'is NOT in the last ... days'. 

 

Is there a smart way to make that happen?

 

Thank you!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Create a flag(New column) like this  in date table

Week Type = Switch( True(),
[start week]<=Today() && [end date]>=Today(),"This Week" ,
"Other weeks"
)

 

And filter "Other Weeks" at the page level

 

Refer for week start and end date of your choice - https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Power-BI-Turning/ba-p/1187482

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , Create a flag(New column) like this  in date table

Week Type = Switch( True(),
[start week]<=Today() && [end date]>=Today(),"This Week" ,
"Other weeks"
)

 

And filter "Other Weeks" at the page level

 

Refer for week start and end date of your choice - https://community.powerbi.com/t5/Community-Blog/Any-Weekday-Week-Decoding-Date-and-Calendar-2-5-Power-BI-Turning/ba-p/1187482

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Ended up using the following calendar expression (it's about the last column 'Type'), to filter out the most recent 14 days of data:

 

 

Calendar = 
ADDCOLUMNS (
    CROSSJOIN (
        CALENDAR ( DATE ( 2019, 1, 1 ), NOW() ),
        UNION (
            ROW ( "Time", TIME ( 1, 5, 0 ) ),
            ROW ( "Time", TIME ( 2, 5, 0 ) ),
            ROW ( "Time", TIME ( 3, 5, 0 ) ),
            ROW ( "Time", TIME ( 4, 5, 0 ) ),
            ROW ( "Time", TIME ( 5, 5, 0 ) ),
            ROW ( "Time", TIME ( 6, 5, 0 ) ),
            ROW ( "Time", TIME ( 7, 5, 0 ) ),
            ROW ( "Time", TIME ( 8, 5, 0 ) ),
            ROW ( "Time", TIME ( 9, 5, 0 ) ),
            ROW ( "Time", TIME ( 10, 5, 0 ) ),
            ROW ( "Time", TIME ( 11, 5, 0 ) ),
            ROW ( "Time", TIME ( 12, 5, 0 ) ),
            ROW ( "Time", TIME ( 13, 5, 0 ) ),
            ROW ( "Time", TIME ( 14, 5, 0 ) ),
            ROW ( "Time", TIME ( 15, 5, 0 ) ),
            ROW ( "Time", TIME ( 16, 5, 0 ) ),
            ROW ( "Time", TIME ( 17, 5, 0 ) ),
            ROW ( "Time", TIME ( 18, 5, 0 ) ),
            ROW ( "Time", TIME ( 19, 5, 0 ) ),
            ROW ( "Time", TIME ( 20, 5, 0 ) ),
            ROW ( "Time", TIME ( 21, 5, 0 ) ),
            ROW ( "Time", TIME ( 22, 5, 0 ) ),
            ROW ( "Time", TIME ( 23, 5, 0 ) ),
            ROW ( "Time", TIME ( 24, 5, 0 ) )
        )
    ),
    "DateTime", [Date] + [Time],
    "Hour", HOUR ( [Time] ),
    "Weekday", WEEKDAY([Date]),
    "Type", IF(DATEDIFF([Date],TODAY(),DAY)<=14,"Cool-off","Relevant")
)

 

 

Fowmy
Super User
Super User

@Anonymous 

You need to modify your measures so that the selected date range will be excluded.

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

I accept KUDOS 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors