Filter by date parameter

Hi community,

I have a column name - ‘Monthnum’ and the values in it are arranged like:

202001
202002
202003
.
.
.
202105
and so on

On a monthly basis I have to change the filters to run the filter on the previous month. So for example if I have to run the report in the month of June 2020 , the filter I have to select or the value in the filter is 202005

Could you please advise how can I put this into a formula or parameter to ‘automatically’ take month number as that of previous month with the format of monthnum column? ?

Hi Vaibhav,

You can use the the “Filter by condition” action with the following expression:
asnumber(format(monthstart(addmonths(now(), 0-1)), "yyyyMM")) = [monthnum]

You’ll have to remove the asnumber() function form the expression if your month numbers are stored as text.

1 Like

Thanks @andrew.rybka for the super quick reply!

I will check and get back to you.