Sum Aggregation on present and last year

I have a Kibana table which contains year wise sales data. Now I want to add a new column which should contain the sum of sales of selected month to current month in the previous year.

Ex: The table contains all the sales data of current year (2019) month wise. If the user select the month January as a month filter, in the last column of the table I want to show the sum of sales from Jan to July (current month) in the last year (2018)

One way to do this is with a Markdown table in TSVB. Each aggregation you add has an Offset parameter in the Data Options tab.

In the screenshot below I constructed the table in Markdown format

|Max Avg Ticket Price - Now|Max Avg Ticket Price - 1d ago|
|--|--|
|{{ max_avg_ticket_price_now.last.formatted }}|{{ max_avg_ticket_price_1_d_ago.last.formatted }}