Month filter and visuals showing month before

Hi all :slight_smile:

I have one filter with month selection (single select) and a visual (pie chart) that shows data related to the selected month.

Does someone know how I can have another pie chart to show data for the month before the one that is selected ? (without any other selection requirement). I can either use month name or month number.

Best regards

Do you have a date field?

If so, you can use parameters and the addDateTime function.

For the previous month you would actually need to add a month to have it sync with the current month.

previous_month_filter = addDateTime(1,β€˜MM’,{date_field})

To get it to a number you can use the extract function. Extract - Amazon QuickSight

So it would look like this. previous_month_number = extract(β€˜MM’,addDateTime(1,β€˜MM’,{date_field}))

Then you can go into the previous month pie chart and have this field equal to your parameter month number. While the other pie chart has your regular date month number equal to your parameter month number.

Hope this helps

Hi @Max,

thank you for your answer !
I do not have a date field. It’s a text field which has the month name as value
I’m not used to parameters yet, but I will try to create some and assign them to visuals

thanks

1 Like