Skip to content

Advanced Chart Calculations

18 min read · Updated 4 Nov 2026

Advanced chart calculations (advanced operations) are a new feature that allows users to apply Advanced calculations on measures used in a chart.

Using this, users can calculate various growth rates, moving averages, accumulated values, and more with a simple, intuitive no-code UI.
This feature enables end-users to access self-service analytics.

Check this data app for detailed use cases and a live example.

https://www.astrato.io/demo-apps/advanced-calculations

​Advanced Calculation Types

There are several categories of advanced calculations:

  • Moving Aggregations - this category returns the cumulative result of a range of records.

  • Period over Period - This category returns a value calculated using the current and comparison records.

  • Nested Calculations- Calculate the aggregation using an internal dimension only if this calculation.

  • Other- Ranking, Totals and more.

Optional advanced calculations:

Category

Type

Description

Formula

Moving Aggregations

Running total

Returns the cumulative result of all records up to the current record, including the current record

Moving Calculation

Returns the cumulative result of a set of records as defined by the user.

Running Rate

Returns the cumulative rate of all records up to and including the current record , the rate is calculated by dividing the cumulative value by the total value of the measure

Period over Period

Value

Returns the value of the comparison record

[comparison record]

Difference

Returns the difference between the current record and the comparison record

[current record]

-

[comparison record]

Rate

Returns the rate between the current record and the comparison record

[current record]

/

[comparison record]

Growth

Returns the growth rate between the current record and the comparison record

([current record]

/

[comparison record])-1

Correlation

Returns the correlation of two records from different periods

Accumulated Growth

Returns the growth rate by comparing the running total of two measures

running total(measure)

/

running total(reference)

-1

Annulized Period Growth

Returns the growth rate between periods in annualized value.
​n- represents the number of periods in a year.

power(([current record]

/

[comparison record]),n) -1

CAGR- compound annual growth rate

Returns the compound growth rate over multiple periods.

n- represents the number of years from the previous period.

power(([current record]

/

[comparison record],-n),1/n) -1

Others

Rank

Returns the rank of a measure by the selected dimensions

Rank(measure)

Total

returns the total value of a measure by the selected dimension

Sum(measure)

Compare to total

returns the result of a measure vs the total result of a measure.
There are different options of comparison.

measure/ sum_total(measure)

measure - avg_total(measure)

Nested Calculations

Nested Calculation

Returns the aggregate result of a measure after calculating an internal virtual table using an additional dimension just for this measure.
For example:
The average of unique active users in the last 30 days

avg(measure splited by dimension)

Nested Ratio

Returns the ratio of the measure aggregated on two different internal levels
For example:
The Avg daily active users divided by the monthly active users

avg(measure split by dimension 1)

/

max(measure splited by dimension 2

Nested Correlation

Returns the correlation coefficient for two dimensions or two measures

Corr(Value1,Value2)

There are several types of advanced calculations:

  • Moving calculations- that return an accumulated result of several records,
    Some use cases are:

    • Accumulated ARR - This shows the ARR growth over time by the date a deal was closed.
      ​

      Bar chart titled ARR Growth over time showing revenue accumulating quarter by quarter from 2021-1 to 2024-1, reaching $25.7M.

    • Daily users Moving Avg - Show your users a 7-day average for each date to remove the impact of weekdays and outliers.
      ​

      Line chart titled Monthly Active User Trend with 6 months moving avg, comparing Active Customers with a smoother moving average line.

      ​

  • Comparison- compare the current record to a different record.
    Some use cases are:

MoM Growth displays the percentage of growth between the current record and the previous record.
​



Activating the advanced calculations option for a measure is easy and intuitive.

You can expand the measure you want to use in the Data tab of the visualization properties panel.

Click on the drop-down menu near the Advanced operation label and select the calculation method you want to use.

Advanced operation drop-down in the Revenue measure settings listing None, Running total, Moving calculation, Value, Difference, Rate and Growth.

​Advanced Calculation Types

We’ll use this data as a reference for the detailed explanation of each type of calculation.

Table of Revenue by orderQuarterYear from 2021-1 to 2024-1, with a $25,708,810.7 total row, used as the reference data.

These are the different types of advanced calculations:

  • This option calculates the cumulative results of all the records up to the current record, including it.
    A common use case is to show the ARR growth over time.

    • Select one of the four optional aggregations to define the measure.

    • If there are multiple dimensions in the chart, select the dimension to use for the running total.

    • Order By - when there are multiple running totals in a table, you can order them by different measures or dimensions
      ​

      Advanced calculation set to Running Total with Aggregation Sum, a Dimensions selector and an Order by option.

This is the result of a running total calculation using the above table
​

Table with orderQuarterYear, Revenue and Revenue Running Total columns, the running total growing to $25,708,810.7 by 2024-1.

  • This option calculates the cumulative result of the set of records the user defines.
    A common use case shows a moving average to reduce the impact of seasonality and outliers.
    ​

    Advanced operation set to Moving calculation with Aggregation Avg, Rows before -2, Rows after 0 and Null if there are not enough values checked.

    • Aggregation - select one of the four options.

    • Rows before- set the start of the range of records to use in the calculation. negative values mean records before the current record, and positive values mean records after the current records.

    • Rows after- set the end of the range of records to use in the calculation.

    • Null if there are not enough values - when checked for records, they are close to the chart’s start or end. a value wouldn’t be displayed
      (In the above example - a value will be displayed only from the seventh record onward)

    Below is an example of each record’s moving average of the previous two months and the current record.
    ​

    Table of Revenue and Revenue Moving Average by quarter, with the first two rows empty and $1,343,741.4 at 2021-3.

    ​

  • An everyday use case shows the cumulative rate of customer churn and finds the type of customers who are less likely to churn.
    This chart shows the cumulative rate of deals closed based on the time it took to close them; it helps find the type of deals that are easier and faster to close.

    Advanced calculation drop-down showing Running R…, with Aggregation Sum, a Dimensions selector and an Order by option.

    • Select one of the four optional aggregations to define the measure.

    • If there are multiple dimensions in the chart, select the dimension for the running total.

    • Order By - when multiple running totals are in a table, you can order them by different measures or dimensions.

    Below is an example of a chart that compares the revenue progress over the months to the different years.
    We can learn from the chart for example that only in 2024 we got to 50% of the income in the first half of the year
    ​

    Line chart of cumulative revenue rate by month for 2022, 2023 and 2024, each climbing from near 0% to 100%, with 2024 ahead.

    ​
    ​

  • This option shows the value of the selected record instead of the current record’s value.
    A common use case compares the current Quarter to the same Quarter in the previous year.

    Settings panel with Advanced operation set to Value and Compare with record set to -4.

    The table below shows each value vs. the same Quarter’s value in the previous year.
    ​

    Table of Revenue by order quarter next to a Revenue Same Qtr Previous Year column showing each quarter’s value from a year earlier.

    ​
    ​

  • This option calculates the difference between the current record and the compared record using this formula:
    ​current record - comparison record

    Settings panel with Advanced operation set to Difference and Compare with record set to -1.

    The table below shows the difference between each quarter and the previous quarter.

    Table of Revenue by order quarter with a Revenue Difference column; negative differences such as -$473,428.9 are highlighted in red.

  • This option calculates the rate between the current record and the compared record using this formula:
    ​current record/comparison record
    ​

    Settings panel with Advanced operation set to Rate and Compare with record set to -1.

    The table below shows the rate between each quarter and the previous quarter.

    Table of Revenue by order quarter with a Revenue rate column showing percentages such as 136% and 73%.

  • This option calculates the growth rate between the current record and the compared record using this formula:
    ​current record/comparison record -1
    ​

    Settings panel with Advanced operation set to Growth and Compare with record set to -1.

The table below shows the growth rate between each quarter and the previous quarter.

Table of Revenue by order quarter with a Revenue QoQ column showing percentages, negative values such as -27% in red.

  • This option calculates the correlation between a period-over-period measure of two dimensions in the query.
    It is primarily used in a heatmap or a correlation matrix.
    ​

    Settings panel with Advanced calculation set to Correlation, Date as an additional dimension, Compare with period -1 and Comparison type Percentage.

  • Settings

    • Additional dimensions - these are the dimensions used to calculate the correlation, one of which will typically be a date or timestamp field.

    • Compare with the period- set, specifying how many records to compare back.

    • Comparison type - there are three options:

      • Absolute- return the difference between the two values.

      • Percentage- returns the rate change between the two values.

      • Natural log- compares the two values using the natural logarithm.

  • This option calculates the growth rate between the running total of the measure and the running total of a reference measure using this formula:
    ​running total(measure)/running total(reference measure) -1
    ​

    Settings panel with an Advanced calculation selected, Revenue Prev Year under Compare Measure and Order Date New under Order by.

    The Order by section controls the sorting order for the measure and overrides the visualization sorting order.

    The table below shows the running totals for the current and previous years in the right free column, and the accumulated growth result is shown in the rightmost column.

Table by orderMonth showing Revenue Current YTD, Revenue Previous Year, Revenue YOY, running totals for both years, and Running Total YOY growth.

  • This option calculates the annualized growth rate between two periods. Usually, this is used to compare the quarter-over-quarter or month-over-month growth to the expected year-over-year growth.
    ​power(Current Preiod/Previous Period, n) -1

    where n is the number of periods in a year.
    The image below shows annualizing quarter-over-quarter.

    Advanced calculation settings set to Annualize, with Compare with period -1 and Number of periods in a year 4.

    The table below shows the Annualized Growth Rate compared to the regular Growth Rate.

    Table of quarters from 2023 Q1 to 2025 Q4 with Total Revenue, Annualized Growth Rate and the regular Growth Rate side by side.

  • This option calculates CAGR, which is the average growth rate over two periods. Usually, it is used to calculate the average return on investment over multiple years.
    ​power(([current record] /[comparison record],-n),1/n) -1

    where n is the number of periods back
    The image below shows CAGR over four years

    Advanced calculation settings set to Compound, with Compare with period set to -4.

    The table below shows the CAGR compared to the regular Growth Rate.

    Table by year from 2017 to 2025 showing Distance (km), CAGR (4 years) and Growth Compare to 4 Years ago.

  • A nested time dimension is needed when you try to calculate a period-over-period measure, but you don’t want to display the time dimension.
    For example, displaying YoY value in a KPI, or showing YoY value for countries in a bar chart.

    • Supported Period-over-Period Calculations in nested mode:

      Section titled “Supported Period-over-Period Calculations in nested mode:”
      • Value

      • Difference

      • Rate

      • Growth

      • CAGR - Compounded Annual Growth Rate

      • Annualized Period Growth

    • Two types of measures are supported in the nested time dimension mode.

      The measure must include a time filter.

      • Measures that include a predefined time period filter.

        For example, the measure below.

        Measure editor with Sum of Sales Data Sales Amount, filtered on Predefined Periods Flags Order Date New with Predefined period set to Current YTD.

        When a predefined filter is used, the offset unit in the advanced calculation is automatically set based on the period.
        In the above example, the offset unit will be Year.
        ​

      • A measure that includes a time period filter that is defined using parameters.
        For example, the measure below is filtered to a period that end users can set.

        Measure editor with Sum of Sales Amount filtered by Order Date New, at or after parameter start_date (2023-01-01) and at or before end_date (2023-12-31).

        When this type of measure is used, the offset unit in the advanced calculation is defined manually by the user.
        ​

    • Defining the Advanced Calculation in the Visualization

      Section titled “Defining the Advanced Calculation in the Visualization”

      In the advanced calculation, when selecting a period-over-period calculation.

      Activate the Nested time dimension switch.

      If you use a parameterized period filter, select the offset time period.
      The number of units for the offset is defined in the comparison with period control.

      Growth calculation settings with Compare with period 1, a Nested time dimension option, and the Time period menu open with Month selected.

      ​

This option returns the rank of a measure by the defined dimension.

The settings for rank are:

Rank calculation settings with Order set to Desc, Dense ticked, and the Dimensions list open with Customer Country checked.

  • Order- defines how to sort the measure when performing the ranking.

  • Dense- defines the type of ranking, rank, or dense rank.
    the difference is illustrated in the table below:

    Example table of IDs and values comparing RANK() and DENSE_RANK(): tied values of 10 both rank 2, then the next value ranks 4 or 3.

  • Dimensions- define the dimensions that the ranking is done by.
    By default, the ranking will be done across all the rows in the table.

The table below shows the Rank columns using the revenue value; one is total with no dimension defined, and one with country as the dimension for ranking.

Table of Occupation by Customer Country with Revenue, a Total rank column and a Country Rank column that restarts at 1 for each country.

This option returns a measure’s total\ sub-total value by the defined dimensions combinations.
​

Advanced calculation set to Total, with Aggregation Sum and a Dimensions dropdown open listing Occupation and Customer Country checkboxes.

The settings for the total option are:

  • Aggregation- select one of the options: Sum, Min, Max, Avg, Precentile.
    When selecting Percentile, there are three additional settings:

    Nested Calculation settings with Aggregation set to Percentile, Percentile value 0.5, and Continuous and Approx toggles.

    • Percentile value- Which percentile result should be calculated for example:
      0.5 will return the median value.

    • Continuous- when disabled, Astrato uses the percentile_disc function that returns the dataset value equal to or greater than the defined percentile.
      When enabled, Astrato uses the percentile_cont function that calculates the percentile value based on the values in the dataset; the result is usually a value that isn’t in the dataset.

    • Approx- When enabled, the approx_percentile function is used. (currently available only in Snowflake and Databricks connections)
      ​

  • Dimensions- define the dimensions by which the aggregation is done.
    By default, the aggregation will be done across all the rows in the table.

The Table below shows each country’s total and average revenue per occupation.

Table of Customer Country and Occupation with Revenue, Revenue Grand Total (11,038,845) and Country Avg Revenue columns.

This option allows comparison to a total value in different ways; use cases for this option can be
Compare each value to the average value, compare each value to the max value, or calculate the share of the total.

The settings for comparison to the total are:
​

Advanced calculation set to a Compare option, with Type of comparison Rate, Aggregation Sum and a Select dimensions dropdown.

  • Type of comparison- there are three different types of comparison.

    • Rate- divide the measure by the total result, for example, the share of the total.
      ​measure\ total_sum(measure)

    • Difference- subtract the total result from the measure; for example, compare the measure to the average result.
      ​measure - total_avg(measure)

    • Growth- divide the measure by the total and substruct 1, for example, show the growth vs the average result

      measure/total_avg(measure)- 1

  • Aggregation- select one of the options: Sum, Min, Max, Avg, Precentile.
    When selecting a percentile, there are two additional settings:
    ​

    Nested Calculation settings with Aggregation set to Percentile, Percentile value 0.5, and Continuous and Approx toggles.

    • Percentile value- Which percentile result should be calculated for example:
      0.5 will return the median value.

    • Continuous- when disabled, Astrato uses the percentile_disc function that returns the dataset value equal to or greater than the defined percentile.
      When enabled, Astrato uses the percentile_cont function that calculates the percentile value based on the values in the dataset; the result is usually a value that isn’t in the dataset.

    • Approx- When enabled, the approx_percentile function is used. (currently available only in Snowflake and Databricks connections)
      ​

  • Dimensions- define the dimensions by which the aggregation is done.
    By default, the aggregation will be done across all the rows in the table.

The Table below shows each occupation’s share of the country’s revenue, the average revenue per occupation, and the difference and growth compared to the country’s average.

Table of Revenue by country and occupation with share, country average, difference and Growth vs Avg columns, negatives marked red.

​

This option allows for adding a dimension specifically for the measure.

This allows, for example, the presentation of the monthly revenue for each country and occupation.
These are the settings for nested calculation:
​
​

Advanced calculation set to Nested Calculation, with Aggregation Sum and an Additional Dimensions section with a plus button.

  • Aggregation- select one of the options: Sum, Min, Max, Avg, Precentile.
    When selecting a percentile, there are two additional settings:
    ​

    Nested Calculation settings with Aggregation set to Percentile, Percentile value 0.5, and Continuous and Approx toggles.

    • Percentile value- Which percentile result should be calculated for example:
      0.5 will return the median value.

    • Continuous- when disabled, Astrato uses the percentile_disc function that returns the dataset value equal to or greater than the defined percentile.
      When enabled, Astrato uses the percentile_cont function that calculates the percentile value based on the values in the dataset; the result is usually a value that isn’t in the dataset.

    • Approx- When enabled, the approx_percentile function is used. (currently available only in Snowflake and Databricks connections)
      ​

  • Additional dimensions- the list of internal dimensions to include when calculating the measure.

The table below shows the average monthly revenue in each row, although the month isn’t a dimension in the table.

Customer Sales Comparison table of Sales Country and Occupation with an Avg Monthly Revenue column, such as $96,201.3 for Australia Professional.

This option allows for adding dimensions specifically for the measure.

This allows, for example, the stickiness rate of a SAAS product
by calculating the ratio between average daily active users and monthly active users.
The settings for this option are:

Advanced calculation settings with Nested Ra… selected, showing Aggregation Avg, Bottom Aggregation Sum, and Additional Dimensions and Bottom Dimensions sections.

  • Aggregation- the type of external aggregation used in the numerator expression.

  • Bottom Aggregation- the type of aggregation to use in the divider expression.

  • Additional dimensions- the internal dimensions to add to the numerator expression.

  • Bottom dimensions- are the internal dimensions to be added to the divider expression.

This option returns the correlation coefficient between an independent and dependent variable.
There are two types of correlation supported

  • Correlation between two dimensions using one measure.
    A typical example is a correlation matrix.

    Heat map titled Sales Correlation by Product Subcategory, showing correlation percentages between subcategories such as Bike Racks, Helmets and Vests.

  • Correlation between two measures using one dimension.
    A typical example will be the correlation of two measures over time.
    ​

    Line chart titled Sales and Gross profit correlation over time, with correlation percentages swinging between positive and negative from 2022 to 2025.

    Below are the settings for nested correlation​
    ​

    Advanced calculation settings with Nested Co… selected, showing Additional Dimensions set to Order Date New and an empty Compare Measure section.

  • Additional Dimension- The dimension that will be used to create the pairs of values from the independent and the dependent variables.
    Typically, this will be a date dimension, as correlation is tested over time.
    ​

  • Compare measure- A measure that will be the dependent variable if the correlation is between two measures.

    This setting should be used only if the chart has one dimension.

These settings enable the definition of different periods, and the measure will be calculated for each period separately. The results are then compared, and the measure returns the value of the comparison between the two ranges.

These settings are only available at the moment for these two advanced calculations:

  • Period-over-period correlation

  • Nested correlation

These are the settings:

Ranges comparison settings with Range 2025-01-01 to 2025-04-29, Comparison Range 2024-01-01 to 2024-04-29, and Comparison type set to Percentage.

The date ranges can be defined by variables, allowing end-users to change the ranges.
There are two options for comparison:

  • Absolute- calculating the difference between the two ranges.

  • Percentage- calculating the percentage change between the two ranges.

Currently, advanced calculations are only available in these visualizations:

  • Bar Chart

  • Combo Chart

  • Line Chart

  • Table

  • KPI

  • Dot Plot

  • Scatter Chart

  • Heat Map

  • Pie Chart

  • Radar Chart