The AVG Function in Looker Studio (formerly Google Data Studio) is an incredibly versatile tool that allows for the calculation of an average value across a selection of numbers. Perfectly suited for analyzing numeric fields in your data, the AVG function improves the precision of your data evaluations, offering insightful observations that are indispensable for intelligent decision-making.
The syntax for the AVG function is a simplistic, yet powerful one:
The parameter 'value' represents a field or expression that evaluates to an unaggregated number. This parameter is key in determining the average of a given numeric field. However, it's crucial to avoid using this function for a pre-aggregated field or an expression resulting from another aggregation function, as doing so may lead to errors.
Though simplistic in its usage, the AVG function works in a sophisticated manner. By taking a single numeric field or numeric expression as a parameter, the AVG function calculates the average value of all entries for that field or expression. However, there are exceptions to this criterion - the function cannot be applied to a field that is pre-aggregated, or an expression influenced by another aggregation function. There are ways to circumvent this issue by altering Aggregation to 'Average' in a data source or by modifying the field's aggregation in a report.
Let's consider a practical example within a sales-oriented context to get a better understanding of the AVG function in action.
Assuming you have a data field of 'Quarterly_Sales' for an e-commerce store, and you wish to calculate the average sales per quarter, the AVG function can be employed as such:
Similarly, if you wish to calculate the average sales of a specific product category as opposed to the entire catalog, the function could be tweaked with the CASE clause:
This fetches an average of all sales within the 'Electronics' category, while ignoring other product categories.
While the AVG function is an advanced resource, it is not without its constraints. An important limitation is its inability to function with pre-aggregated fields or expressions resulting from other aggregation functions. Efforts to bypass this limitation with AVG(SUM(x)) tends to yield errors.
Despite the limitations, AVG can open a world of possibilities with data analysis by using the following tips:
Unlock the potential of your data analysis with the AVG function, drive evidence-based decisions, and watch your business grow.
Become a Looker Studio expert
for free
Learn all the secrets of data analysis and create beautiful and effective dashboards thanks to our 30-second video courses! Join Catchr's community on YouTube.
Get more video lessonsAll your data on Looker Studio
Build Looker Studio dashboard easily with your marketing data from all platforms and track your essential KPIs! No-code integration.
Start free trial now!Optimize your data analysis
Get free Looker Studio dashboard template among a large collection of +50 stunning template! Elevate your data visualization.
Get free templates!