Forum Discussion
Show items between start and end dates
- 4 years ago
You could swap the MIN('Date'[Date]) for MAX('Date'[Date]), that should do it
Thank you for your response! I have gone ahead and create the measure, but now I'm just a bit confused on where I'm applying it and what field I'm using as my date filter. So, you said to place the measure on the visual which I'm assuming you mean in the filter pane? If that's correct, do I need to set it to equal 1 in the filter pane? As for the filter drop down, which field am I using? A date field from the date table? If you had screenshots of how you'd apply this, that would be great. You don't have to use it on a Gantt chart obviously but seeing it would be a bit easier to see where you're coming from. I appreciate your response though!
Yes, place the measure on the filter pane like
You would use the Date field from your Date table on the slicer.
- JLambs204 years agoHelper III
For the most part, this works pretty well, although I have discovered some limitations (to be fair, I didn't ask for this in the beginning). But let's say I want to see everything that is going on in February. If I have an entry that starts on Feb 10 and ends sometime in March, that entry will not be reflected in my visual since it doesn't occur in all of February. I'm not sure how to address that (or if it's even possible)?
- johnt754 years agoSuper User
You could swap the MIN('Date'[Date]) for MAX('Date'[Date]), that should do it
- JLambs204 years agoHelper III
I think you may be on to something here. So far, it looks like it works but I'm going to QC it some more and if that's the case, I'll accept it as the solution! Thank you so much!
- Icey4 years agoCommunity Support
Hi JLambs20 ,
Do you mean to only show that both the start date and end date are within the selected date range? For example:
Is Task Visible = VAR startDate = SELECTEDVALUE ( 'Table'[start date] ) VAR endDate = SELECTEDVALUE ( 'Table'[end date] ) RETURN IF ( startDate >= MIN ( 'Date'[Date] ) -----------------changed && ( ISBLANK ( endDate ) || endDate <= MAX ( 'Date'[Date] ) --------------changed ), 1, 0 )For more details, please check the attached .pbix file.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- JLambs204 years agoHelper III
Hello Icey!
From what I'm seeing, you are close but it's not quite what I'm after. If you look at my screenshot here, there are two tasks (green/dark blue) that span a few similar dates. In this case, they both span Jul 22 to Jul 31. However, the bottom task (dark blue, kind of obscured) does not start or end within that time range.So what I am looking for is if I were to select an individual date, or a particular month, I would like to see all of the tasks that either start, end, or occur in my selection. But as you can see below when I select just July, nothing appears in the gantt.
If I could select either a year, quarter, month, or day and see all tasks in that date range, regardless of whether they start, end, or occur in that date frame, that's what I'm ultimately after.
So, in the above example, when I select the month of july, I want to be able to see both the green and dark blue tasks in the gantt chart because they both occur in July, even though the dark blue task does not have a start or end in July. Make sense?
Thanks!
Josh