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
You should definitely build a proper date table, that helps with all sorts of things such as time intelligence measures and making sure that all possible dates are available for a user to select from a slicer, not just the dates which appear in your data.
In this case you wouldn't want the date table to be related to your data table. As you said, that would filter just those tasks which started on a particular date.
You can create a measure and use that as a filter on the visual where you want to show tasks.
Is Task Visible =
var startDate = SELECTEDVALUE('Table'[start date])
var endDate = SELECTEDVALUE('Table'[end date])
return IF( startDate <= MIN('Date'[Date]) &&
( ISBLANK( endDate) || endDate >= MAX('Date'[Date]) ),
1, 0 )This will allow users to select either a specific date or a range of dates. Add it as a filter to only show rows when the value is 1
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!
- johnt754 years agoSuper User
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