Hello @miguelantunesp, I can help with that!
The visual that is month selected, you can use a calculated field to apply the filter.
ifelse(truncDate(‘MM’, ${DateParam}) = truncDate(‘MM’, {DateField}), 1, 0)
Then, for that visual, apply that calculated field as a filter, set it to No Aggregation, and equals 1. That will show only for the selected date month.
For the 12 months prior, you may have to adjust slightly if you don’t want the selected month included, but we can use another calculated field.
ifelse(truncDate(‘MM’, {Date Field}) >= addDateTime(-12, ‘MM’, truncDate(‘MM’, ${DateParam})) AND truncDate(‘MM’, {Date Field}) <= truncDate(‘MM’, ${DateParam}), 1, 0)
Once again, apply a filter to all of the required visuals where you use No Aggregation and Equals 1.
One thing to note, make sure you set the last dropdown to Exclude NULLs for both of these filters. That should handle the use cases. Feel free to adjust the 2nd calculated field to handle the proper greater than and less than scenario depending on what dates you want to include/exclude.