Compare this month and last month in line chart

Hi there,

I’m finding a way to add a line of previous month in this line chart but i don’t really know how to do it. Thanks a lot !
image

I did create this chart by create a calculated field:
coalesce(sumIf({count_clicks}, truncDate(‘DD’, {transactions_sales_time}) >= truncDate(‘DD’, ${Datefrom}) AND truncDate(‘DD’, {transactions_sales_time}) <= truncDate(‘DD’, ${Dateto})),0)

and limit time range by filter {transactions_sales_time}.

Hi @thecuon119
Maybe you can have a look at

BR

Is there any other simple way ? I’ve tried to follow the steps but it didn’t work

periodOverPeriodLastValue - Amazon QuickSight
This one could work, but on a daily granularity it doesn’t work to 100% yet. sadly not every month has the same amount of days.
BR
Robert

Hi @thecuon119
Did you found a solution?
BR

Hi @thecuon119

If wanting to look at chart with date field and potentially multple months, would suggest using periodoverperiodlast value as suggested above.

Another option, specially if mainly doing daily sales this month vs last month is to 1. create calc field for day num 2. use ifelse functions to calculate the two periods you want to compared. (to-from dates) and formulas as shown here.

lastmonth

This dashboard shows the two options side by side.