Forum Discussion
Defaulting date range with date slicer
- 4 years ago
Hi racope
You may try this Measure.
IsOrNot =
VAR Today_ =
TODAY ()
VAR Year_ =
YEAR ( Today_ )
VAR Month_ =
MONTH ( Today_ )
VAR StartDate =
DATE ( Year_ - 2, Month_, 1 )
VAR EndDate =
DATE ( Year_, Month_, 1 ) - 1
RETURN
COUNTX (
FILTER (
'calendar',
'calendar'[Date] >= StartDate
&& 'calendar'[Date] <= EndDate
),
'calendar'[Date]
)
And then, use this Measure to filter your date Slicer.
Then, the result should look like this:
For more details, please refer to the attached pbix file.
Best Regards,
Community Support Team _ Caiyun
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. If you still have problems on it or I misunderstand your needs, please feel free to let us know. Thanks a lot!
Hi racope
You may try this Measure.
IsOrNot =
VAR Today_ =
TODAY ()
VAR Year_ =
YEAR ( Today_ )
VAR Month_ =
MONTH ( Today_ )
VAR StartDate =
DATE ( Year_ - 2, Month_, 1 )
VAR EndDate =
DATE ( Year_, Month_, 1 ) - 1
RETURN
COUNTX (
FILTER (
'calendar',
'calendar'[Date] >= StartDate
&& 'calendar'[Date] <= EndDate
),
'calendar'[Date]
)
And then, use this Measure to filter your date Slicer.
Then, the result should look like this:
For more details, please refer to the attached pbix file.
Best Regards,
Community Support Team _ Caiyun
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. If you still have problems on it or I misunderstand your needs, please feel free to let us know. Thanks a lot!