Forum Discussion
filter table between two values with date dimension
nick9one1 Add a calculated column to your backlog table to determine if the record falls within the selected financial year and quarter.
DAX
IsInSelectedPeriod =
VAR StartDate = [StartDate]
VAR EndDate = [EndDate]
VAR SelectedStartDate = CALCULATE(MIN('Date'[Date]), ALLSELECTED('Date'))
VAR SelectedEndDate = CALCULATE(MAX('Date'[Date]), ALLSELECTED('Date'))
RETURN
IF (
(StartDate <= SelectedEndDate) && (EndDate >= SelectedStartDate),
1,
0
)
Use this calculated column to filter your backlog table in your report. You can add a visual level filter or a page level filter to only show records where IsInSelectedPeriod is 1.
If you need to create measures for reporting purposes, you can use a similar logic in your measures. For example:
DAX
BacklogCount =
CALCULATE(
COUNTROWS('BacklogTable'),
FILTER(
'BacklogTable',
'BacklogTable'[IsInSelectedPeriod] = 1
)
)