Forum Discussion
Filter based on date
- 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")
AllisonKennedy
Im bumping this question and wondering if theres something else besides a measure to use for a solution.
I have seen that I cannot use the measurement in all the visuals that I'd like.
I want to have a slicer button for yes/no that filters visuals based on the above measure or inactive filter.
- AllisonKennedy3 years agoCommunity Champion
Anonymous Are you using import or direct query? If Import, you can use the same formula as a new column and that can be used as a slicer (if I understand what you're asking correctly?)
- Anonymous3 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 workingInaktiv2 =VAR _LastDate = MAX('sub_info'[Senast aktiv]) + 0VAR _CutoffDays = 365VAR _DaysSinceLastUsed = DATEDIFF( _LastDate, TODAY(), DAY)RETURNIF(_DaysSinceLastUsed > _CutoffDays, "Inaktiv")- AllisonKennedy3 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] +0VAR _CutoffDays = 365VAR _DaysSinceLastUsed = DATEDIFF( _LastDate, TODAY(), DAY)RETURNIF(_DaysSinceLastUsed > _CutoffDays, "Inaktiv")