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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
LotteLaugesen
Helper V
Helper V

Dynamic filter depending on another filter

Hi 

 

I would like to have a date filter showing the last 7 or 14 days depending on another filter like this:

LotteLaugesen_0-1651152257200.png

Is it possible?

 

BR

Lotte

1 ACCEPTED SOLUTION
LotteLaugesen
Helper V
Helper V

I have find a way to solve it 🙂

Include Date = IF(SELECTEDVALUE(Weeks[Weeks]) = 1 && SELECTEDVALUE(Dim_Calendar[IndexDay]) < 7,1,IF(SELECTEDVALUE(Weeks[Weeks]) = 2 && SELECTEDVALUE(Dim_Calendar[IndexDay]) < 14,1,0))
 
Where IndexDay is days from today
and then I just put a filter on Date slicer saying that Include Date should be 1

 

View solution in original post

3 REPLIES 3
LotteLaugesen
Helper V
Helper V

I have find a way to solve it 🙂

Include Date = IF(SELECTEDVALUE(Weeks[Weeks]) = 1 && SELECTEDVALUE(Dim_Calendar[IndexDay]) < 7,1,IF(SELECTEDVALUE(Weeks[Weeks]) = 2 && SELECTEDVALUE(Dim_Calendar[IndexDay]) < 14,1,0))
 
Where IndexDay is days from today
and then I just put a filter on Date slicer saying that Include Date should be 1

 
amitchandak
Super User
Super User

@LotteLaugesen , Create a measure

 

countrows(filter('Date', Date[Date] <= Today()  && Date[Date] >= Today() - (selectedvalue(Table[Number])*7) ))

 

and check the values is not blank in the visual level filter of the slicer

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

Hi amitchandak

 

It doesn't seem to work - it doesn't matter if I select 1 or 2 week the measure is 1. 
If it worked how could I then use it as a filter for the date slicer?

LotteLaugesen_0-1651219857446.png

 



Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.