Forum Discussion
Filter data with from and to dates using week commencing
- 9 years ago
Hi JordB,
If I understand you correctly, you should be able to follow steps below to get your expected result.
I assume your first table with start/finish date called "Table1", and the second table with week commencing date called "Table2".
1. Remove the relationship between "Table1" and "Table2" if there is.
2. Use the formula below to create a measure to indicate if the rows have a start date < ( the selected wc + 6) and a finish date > selected sc.
IsSelected = VAR currentSelectWC = MAX ( 'Table2'[wc] ) RETURN CALCULATE ( COUNTROWS ( 'Table1' ), FILTER ( 'Table1', 'Table1'[start date] < currentSelectWC + 6 && 'Table1'[finish date] > currentSelectWC ) )3. Then you should be able to use the measure [IsSelect] as a visual level filter on the visualization you're showing your fields, and apply "is greater than 0" to get only selected result. :smileyhappy:
Regards
Hi JordB,
If I understand you correctly, you should be able to follow steps below to get your expected result.
I assume your first table with start/finish date called "Table1", and the second table with week commencing date called "Table2".
1. Remove the relationship between "Table1" and "Table2" if there is.
2. Use the formula below to create a measure to indicate if the rows have a start date < ( the selected wc + 6) and a finish date > selected sc.
IsSelected =
VAR currentSelectWC =
MAX ( 'Table2'[wc] )
RETURN
CALCULATE (
COUNTROWS ( 'Table1' ),
FILTER (
'Table1',
'Table1'[start date]
< currentSelectWC + 6
&& 'Table1'[finish date] > currentSelectWC
)
)
3. Then you should be able to use the measure [IsSelect] as a visual level filter on the visualization you're showing your fields, and apply "is greater than 0" to get only selected result. :smileyhappy:
Regards
Worked a treat, thanks.