Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello! I have a dataset that has project start and end dates, but want the date slicer to still include relative data if it falls within that date range.
For example, if I filter on the year 2023. I want to be able to see projects that may have started in 2021 but do not have an end date until 2024.... I tried creating a date table and the following InDateRange measure, and then applying the measure = 1 to the visual but it is still not wokring the way i need it to...
Solved! Go to Solution.
Hi @heidtmer ,
Please have a try.
Create a calendar table.
Table = CALENDAR(DATE(2020,1,1),DATE(2025,12,31))
Then put the date column into the slicer.
Then create measures.
_start = YEAR(SELECTEDVALUE('Table'[Date]))-2
year_endrangeend = YEAR(SELECTEDVALUE('Table'[Date]))+1max_start = MAXX(ALLSELECTED(Sheet7),Sheet7[_start])max_end = MAXX(ALLSELECTED(Sheet7),Sheet7[year_endrangeend])Measure = IF(year(MAX(Sheet7[date start]))>=[max_start]&&year(MAX(Sheet7[date end]))<=[max_end],1,BLANK())
Then put the measure into the visual.
If I have misunderstood your meaning, please provide your desired output with more details and you sample pbix file without privacy information.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @heidtmer ,
Please have a try.
Create a calendar table.
Table = CALENDAR(DATE(2020,1,1),DATE(2025,12,31))
Then put the date column into the slicer.
Then create measures.
_start = YEAR(SELECTEDVALUE('Table'[Date]))-2
year_endrangeend = YEAR(SELECTEDVALUE('Table'[Date]))+1max_start = MAXX(ALLSELECTED(Sheet7),Sheet7[_start])max_end = MAXX(ALLSELECTED(Sheet7),Sheet7[year_endrangeend])Measure = IF(year(MAX(Sheet7[date start]))>=[max_start]&&year(MAX(Sheet7[date end]))<=[max_end],1,BLANK())
Then put the measure into the visual.
If I have misunderstood your meaning, please provide your desired output with more details and you sample pbix file without privacy information.
Best Regards
Community Support Team _ Polly
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.