In ErikG’s solution there is a time interval and uses a line graph.
In my case, I am using a table and I must only show the selected month and the calculation fields for the previous month and the previous year).
Follow my calculation fields: Actual month: sum(ifelse( {data_referencia} >=truncDate(‘MM’, EndMonth) AND {data_referencia} <= EndMonth,{qtd_consulta_total},0))
Previous month: periodOverPeriodLastValue(sum(ifelse( {data_referencia} >=truncDate(‘MM’, EndMonth) AND {data_referencia} <= EndMonth,{qtd_consulta_total},0)),{data_referencia},MONTH,1)
At this point I’m curious if it would be better to totally change up how the calculated fields work from using periodOverPeriodLastValue to using the dates selected via the parameter as a filter in the calculated field using addDateTime.
For example, if you created date parameters you could change the calculated fields to something like below:
You might need to experiment with this and your navigation actions, but the basic premise of my thinking here is telling Quicksight exactly what data to show based on two dynamic start and end points.