Forum Discussion
Can I use a Measure in Filter?
- 6 years ago
Hello Velocitym,
You can use a measure as 'Visual Level Filter'. However you can create a calculated column in the date table that returns zero for the days that you don't want to count in the measure.
On the basis of what I think your requirement is, I have created a calculated column as below:
Last Week StartDay = VAR CurrentWeek = WEEKNUM(TODAY()) VAR LastWeek = CurrentWeek-1 VAR LastWeekBeginningDate = CALCULATE(FIRSTDATE('Date'[Date]),FILTER('Date',WEEKNUM('Date'[Date])=LastWeek)) RETURN IF(WEEKNUM('Date'[Date])>=LastWeek && 'Date'[Date]>LastWeekBeginningDate,1,0)And you can use this colujmn to filter out the dates, as LastWeekStartDay<>1.
You can modify the start of the day as you want. I have taken the default start of the week.
Hope this helps. Please let me know if this doesn't work.
Hello Velocitym,
You can use a measure as 'Visual Level Filter'. However you can create a calculated column in the date table that returns zero for the days that you don't want to count in the measure.
On the basis of what I think your requirement is, I have created a calculated column as below:
Last Week StartDay =
VAR CurrentWeek = WEEKNUM(TODAY())
VAR LastWeek = CurrentWeek-1
VAR LastWeekBeginningDate = CALCULATE(FIRSTDATE('Date'[Date]),FILTER('Date',WEEKNUM('Date'[Date])=LastWeek))
RETURN IF(WEEKNUM('Date'[Date])>=LastWeek && 'Date'[Date]>LastWeekBeginningDate,1,0)
And you can use this colujmn to filter out the dates, as LastWeekStartDay<>1.
You can modify the start of the day as you want. I have taken the default start of the week.
Hope this helps. Please let me know if this doesn't work.