Forum Discussion
haichenhuang
2 years agoFrequent Visitor
Date range filter slow performance
Hi there, I want to filter based on date ranges according to this logic: 'Work'[Start Date] <= MAX('Calendar'[Date]) && 'Work'[End Date] >= MIN('Calendar'[Date]) Originally using a date be...
Anonymous
2 years agoNot applicable
Hi haichenhuang ,
Please try this measure:
Filter Measure 2 =
VAR __min_date = MIN('Calendar'[Date])
VAR __max_date = MAX('Calendar'[Date])
VAR __cur_start_date = SELECTEDVALUE('Work'[Start Date])
VAR __cur_end_date = SELECTEDVALUE('Work'[End Date])
VAR __filter = IF(__cur_start_date>=__min_date && __cur_end_date<=__max_date,1)
RETURN
__filter
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum -- China Power BI User Group