Forum Discussion
select which filter to use
- 9 years ago
According to your description, it seems you want to achieve a last X period slicer to filter dates. In this scenario, you need to create a calculated table for each period, and union those calculated tables into a "DatePeriod" table. Then build the relationship to date table for filtering. For more details, please see a blog below:
POWER BI – TIME PERIOD SLICER FOR LAST 7 DAYS,LAST 30 DAYS..
Regards,
I have used a Date Range table with some success. I build one that looks like this
And then I create a measure on my date table that looks like this :
Date Range Filter = if(
MAX('Dates'[Date]) >= NOW() - MIN ('Date Ranges'[ID])
&& MAX('Dates'[Date]) < NOW()
---------------------------------------------------------
,1
,0
)
This should return a 1 or 0 that you can use as a filter on the visual. eg, specifiy that the output of that measure should always be one.
Then you can add a slicer to the report page over the [Date Range] column. This will allow the user to easily select several dynamic date ranges. Just add to the table if you want to offer more interesting ranges.