Forum Discussion
Anonymous
3 years agoNot applicable
Filter based on date
Hello, I have a set of data with subscriptions and there I have a column with date & time that shows when the subscription last was used. The date column/data originally showed date and time but ...
- 3 years ago
You could create a Measure similar to the below and filter for "unused" only
Inactive Filter =VAR _LastDate = MAX('Table'[Date]) + 0VAR _CutoffDays = 365VAR _DaysSinceLastUsed = DATEDIFF( _LastDate, TODAY(), DAY)RETURNIF(_DaysSinceLastUsed > _CutoffDays, "Unused")
Anonymous
3 years agoNot applicable
AllisonKennedy I am getting the data through web/api.
With this in a new column it aint working. In a measure it is working
Inaktiv2 =
VAR _LastDate = MAX('sub_info'[Senast aktiv]) + 0
VAR _CutoffDays = 365
VAR _DaysSinceLastUsed = DATEDIFF( _LastDate, TODAY(), DAY)
RETURN
IF(_DaysSinceLastUsed > _CutoffDays, "Inaktiv")
AllisonKennedy
3 years agoCommunity Champion
Anonymous Since it's a column you won't need the MAX anymore for the date:
Inaktiv2 =
VAR _LastDate = 'sub_info'[Senast aktiv] +0
VAR _CutoffDays = 365
VAR _DaysSinceLastUsed = DATEDIFF( _LastDate, TODAY(), DAY)
RETURN
IF(_DaysSinceLastUsed > _CutoffDays, "Inaktiv")