Forum Discussion
Anonymous
6 years agoNot applicable
Check if date falls between two dates
Hi All Hoping someone can help I have a table which contains various data items for clients including a 'last contacted date'. I need to be able to identify whether the 'last contacted date'...
edhans
6 years agoCommunity Champion
This will return true, false, or "multiple selections" if there isn't one date selected.
Within Two Weeks =
VAR VendorDate =
MAX( Vendors[Last Contacted Date] )
VAR SelectedDates =
ALLSELECTED( 'Date'[Date] )
VAR SelectedDate = [Selected Dates]
VAR DayCount = 14
VAR DateRange =
DATESBETWEEN(
'Date'[Date],
SelectedDate - DayCount,
SelectedDate
)
VAR WithinDateRange = VendorDate
IN DateRange
VAR Result =
IF(
HASONEVALUE( 'Date'[Date] ),
WithinDateRange,
"Multiple Selections"
)
RETURN
Result
The vendor table I mocked up is NOT filtered by the date table (not connected in the model view) because selecting a date removed everything that isn't that exact date. You can modify that to use 28 dates in the DayCount variable.
If you need more help, please provide sample data and more specifics.
How to get good help fast. Help us help you.
How to Get Your Question Answered Quickly
How to provide sample data in the Power BI Forum