Forum Discussion
Filter based on date range in another table
- 6 years ago
Hi Anonymous ,
We can create a calculated table contain all the possible date first (ignore this step if you already have such one):
DateTable = CALENDAR ( MIN ( 'Table'[Created Date] ), MAX ( 'Table'[Closed Date] ) )Then we create a measure to count the number:
BugsCount = SUMX ( 'Table', COUNTX ( FILTERS ( 'DateTable'[Date] ), IF ( [Date] >= 'Table'[Created Date] && [Date] <= 'Table'[Closed Date], 1, BLANK () ) ) )Or
BugsCount = COUNTX ( 'Table', IF ( SELECTEDVALUE ( 'DateTable'[Date] ) >= 'Table'[Created Date] && SELECTEDVALUE ( 'DateTable'[Date] ) <= 'Table'[Closed Date], 1, BLANK () ) )
BTW, pbix as attached.Best regards,
Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I added another table to your dataset. Project
This lets you filter both milestones and bugs either by project or by date.
Here is a simple report that has a slicer based on the project field of the project table
when you click on a project in the slicer it filters both tables
You could also make a slicer based on the date of the calendar table, which would also filter both the bug report and the milestones...
In order to get counts you can just change the bug name field to count
This definitely helps in my relationships, but I need it to display EVERY date. So I need a table like:
| Date | Bug Count |
| 1-1-2000 | 2 |
| 1-2-2000 | 2 |
| 1-3-2000 | 2 |
| 1-4-2000 | 2 |
| 1-5-2000 | 3 |
| 1-6-2000 | 3 |
| 1-7-2000 | 3 |
etc...