Forum Discussion
Filter using different criteria
- Anonymous4 years ago
Hi Anonymous ,
You can create three measures to solve this problem with the bookmark navigator.
Measures.
Filter 1 = VAR _iteration = MAX ( 'DataTable'[Iteration] ) VAR _date = MAX ( 'DataTable'[Epic Actual End Date] ) VAR _start = CALCULATE ( MAX ( 'Table'[Start Date] ), FILTER ( ALL ( 'Table' ), 'Table'[Iteration] = _iteration ) ) VAR _end = CALCULATE ( MAX ( 'Table'[End Date] ), FILTER ( ALL ( 'Table' ), 'Table'[Iteration] = _iteration ) ) VAR _result = IF ( _date >= _start && _date <= _end, 1 ) RETURN _resultFilter 2 = VAR _iteration = MAX ( 'DataTable'[Iteration] ) VAR _date = MAX ( 'DataTable'[Epic Actual End Date] ) VAR _start = CALCULATE ( MAX ( 'Table'[Prev3IterDate] ), FILTER ( ALL ( 'Table' ), 'Table'[Iteration] = _iteration ) ) VAR _end = CALCULATE ( MAX ( 'Table'[End Date] ), FILTER ( ALL ( 'Table' ), 'Table'[Iteration] = _iteration ) ) VAR _result = IF ( _date >= _start && _date <= _end, 1 ) RETURN _resultFilter 3 = VAR _iteration = MAX ( 'DataTable'[Iteration] ) VAR _date = MAX ( 'DataTable'[Epic Actual End Date] ) VAR _start = CALCULATE ( MAX ( 'Table'[Start Date] ), FILTER ( ALL ( 'Table' ), 'Table'[Iteration] = _iteration ) ) VAR _end = CALCULATE ( MAX ( 'Table'[Next3IterDate] ), FILTER ( ALL ( 'Table' ), 'Table'[Iteration] = _iteration ) ) VAR _result = IF ( _date >= _start && _date <= _end, 1 ) RETURN _resultAttached PBIX file for reference.
Best Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
Hi Anonymous ,
You can create three measures to solve this problem with the bookmark navigator.
Measures.
Filter 1 =
VAR _iteration =
MAX ( 'DataTable'[Iteration] )
VAR _date =
MAX ( 'DataTable'[Epic Actual End Date] )
VAR _start =
CALCULATE (
MAX ( 'Table'[Start Date] ),
FILTER ( ALL ( 'Table' ), 'Table'[Iteration] = _iteration )
)
VAR _end =
CALCULATE (
MAX ( 'Table'[End Date] ),
FILTER ( ALL ( 'Table' ), 'Table'[Iteration] = _iteration )
)
VAR _result =
IF ( _date >= _start && _date <= _end, 1 )
RETURN
_resultFilter 2 =
VAR _iteration =
MAX ( 'DataTable'[Iteration] )
VAR _date =
MAX ( 'DataTable'[Epic Actual End Date] )
VAR _start =
CALCULATE (
MAX ( 'Table'[Prev3IterDate] ),
FILTER ( ALL ( 'Table' ), 'Table'[Iteration] = _iteration )
)
VAR _end =
CALCULATE (
MAX ( 'Table'[End Date] ),
FILTER ( ALL ( 'Table' ), 'Table'[Iteration] = _iteration )
)
VAR _result =
IF ( _date >= _start && _date <= _end, 1 )
RETURN
_resultFilter 3 =
VAR _iteration =
MAX ( 'DataTable'[Iteration] )
VAR _date =
MAX ( 'DataTable'[Epic Actual End Date] )
VAR _start =
CALCULATE (
MAX ( 'Table'[Start Date] ),
FILTER ( ALL ( 'Table' ), 'Table'[Iteration] = _iteration )
)
VAR _end =
CALCULATE (
MAX ( 'Table'[Next3IterDate] ),
FILTER ( ALL ( 'Table' ), 'Table'[Iteration] = _iteration )
)
VAR _result =
IF ( _date >= _start && _date <= _end, 1 )
RETURN
_result
Attached PBIX file for reference.
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data