Chicago1988
Chicago1988

Reputation: 684

automatically change the filter of report to current month

I have a complete DimDate table and I want to force, that whenever a user opens the report, he gets current month selected in the filters:

enter image description here

How can I achieve that?

So, on May 1st, the selection should automatically be changed to FY22 – 12 – May by default… Also, the user should be allowed to freely change the month, so I can't really force a hidden filter on current month, because I want to allow the user to be able to change it,

Upvotes: 1

Views: 1690

Answers (1)

Daniel A. Gregersen
Daniel A. Gregersen

Reputation: 126

You can add a column with an IF to test if it's within the current year/month and have that output as a string, like "Current month", and the rest as above. That way you can preselect "Current month" and still have all the other options.

For example I use this in one of my reports:

IF(
    DimDato[ISO year/week] = YEAR( TODAY() + 26 - WEEKNUM( TODAY(), 21 ) ) & IF( LEN( WEEKNUM( TODAY(), 21 ) ) = 1, 0 & WEEKNUM( TODAY(), 21 ), WEEKNUM( TODAY(), 21 ) ),
    "Current week",
    DimDato[ISO year/week]
)

Upvotes: 1

Related Questions