Forum Discussion
Filtering within a date range
- 9 years ago
Hi thmonte,
I want to be able to set the slicer for 2/15/2017 and have this record show up in my visuals but, the slicer is only able use one column as a filter.If I understand you correctly, you should be able to follow steps below to use a Date Slicer to filter your data on your visual. :smileyhappy:
1. Add an individual Calendar table if you don't have one yet(make sure not create any relationship between this table and your original table).
Date = CALENDARAUTO()
2. Use the formula below to create a measure, and use it to apply a visual level filter(Count of Type is greater than 0) on your visual.
Count of Type = VAR currentDate = MAX ( 'Date'[Date] ) RETURN CALCULATE ( COUNTROWS ( Table1 ), FILTER ( Table1, ( Table1[Start Date] <= currentDate && Table1[End Date] >= currentDate ) ) )Note: just replace 'Table1' with your real table name.
Regards
Hi thmonte,
I want to be able to set the slicer for 2/15/2017 and have this record show up in my visuals but, the slicer is only able use one column as a filter.
If I understand you correctly, you should be able to follow steps below to use a Date Slicer to filter your data on your visual. :smileyhappy:
1. Add an individual Calendar table if you don't have one yet(make sure not create any relationship between this table and your original table).
Date = CALENDARAUTO()
2. Use the formula below to create a measure, and use it to apply a visual level filter(Count of Type is greater than 0) on your visual.
Count of Type =
VAR currentDate =
MAX ( 'Date'[Date] )
RETURN
CALCULATE (
COUNTROWS ( Table1 ),
FILTER (
Table1,
( Table1[Start Date] <= currentDate
&& Table1[End Date] >= currentDate )
)
)
Note: just replace 'Table1' with your real table name.
Regards
v-ljerr-msft
How to do the relatationship between 'Date' and 'Table1' when on right side you have [Start date] and [End date]?
Between which fields it should be done?
The measure [Count of Type] returs the count of rows in a selection. How it can filter visual ?