Forum Discussion

taniagn's avatar
taniagn
New Member
5 years ago
Solved

Clean filter button with dates of current month

Hello everyone!

My objective is to create a clean filter button that automatically update itself with the current month.

I have a bookmark that clean filters by saving data as shown bellow.
However, it saves the date range that was displayed at the moment I saved the bookmark, for example (08/01/2021-08/31/2021). As time goes by, I would like the "clean filter button" to automatically bring the dates of the current month.

I tried a couple of things:
1- I created a colunm in my calendar that indicates that flag the current month and added it as a filter.
2- I used a relative date filter in addition to the "between" type of date filter.
I even edited the relations between the filters.
It kinda worked, but both solutions resulted in the utilization of 2 filters and the user had to make selections in 2 visuals, which is not ideal.

Is there a way to solve it? Does anyone have any idea?

Thanks in advance!

  • Create a calculated column in your Calendar table that has a value for "current month"  versus "not current month" 

     

    for example:  

    CM = IF(YEAR(TODAY())=YEAR([date]) && MONTH(TODAY())=MONTH([date]),"Current","Other")

     

    Then base your bookmark on that column equaling "Current".

     

    Now each time your data refreshes this will get recomputed and reassigned.

     

    Caveats:

    - this assumes frequent (daily) dataset refreshes when in import mode. 

    - may perform poorly in Direct Query mode

    - Will not work across multiple timezones.

1 Reply

  • Create a calculated column in your Calendar table that has a value for "current month"  versus "not current month" 

     

    for example:  

    CM = IF(YEAR(TODAY())=YEAR([date]) && MONTH(TODAY())=MONTH([date]),"Current","Other")

     

    Then base your bookmark on that column equaling "Current".

     

    Now each time your data refreshes this will get recomputed and reassigned.

     

    Caveats:

    - this assumes frequent (daily) dataset refreshes when in import mode. 

    - may perform poorly in Direct Query mode

    - Will not work across multiple timezones.