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
Yes, place the measure on the filter pane like
You would use the Date field from your Date table on the slicer.
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!
- JLambs204 years agoHelper III
Hi John,
I was wondering if you could help me out with regards to an addition to this measure. Currently, the default chart shows all values regardless of blanks in the "start" or "end" column. To be clear, that is fine as I want the default to show those items that have blank start dates (I understand how absurd that sounds considering I'm showint a gantt chart). However, I'd like the chart to NOT show those items with blanks when a date in the date slicer is selected. As it sits, the chart will show all of the items that satisfy the date criteria but it's also still showing those with a blank start date. Thank you!
- 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