Compare each group's average with a shared benchmark across all chart dimensions. GROUPFULL removes those dimensions from the benchmark calculation while keeping filters applied. Use this pattern to compare groups with the overall average.
Compare employee groups with a shared company benchmark to see which groups have average salaries above or below the overall average.
Source data: The employees dataset contains one row per employee, with salary and gender columns.
Formula : AVG(salary) / GROUPFULL(AVG(salary))
Calculate the group average: AVG(salary) averages salaries within the current chart group.
Calculate the benchmark: GROUPFULL(AVG(salary)) averages salaries without the chart's grouping dimensions. Filters still apply to both averages.
Compare the averages: Divide the group average by the benchmark. A ratio of 1 means the averages match. Enable percentage formatting on the chart to display the ratio as a percentage.
Example result: With chart percentage formatting, 1.1 displays as 110% , meaning the group's average salary is 10% above the filtered company average.
Measure: In a column chart grouped by gender, shows each gender's average relative to the filtered company average. Enable percentage formatting on the measure.
Having filter: Keep gender groups above the company average using formula > 1 . The threshold uses the raw ratio.
npm install @luzmo/nodejs-sdk{
"count": 1,
"rows": [
{
"created_at": "2024-05-20T12:44:23.163Z",
"currency_id": null,
"description": {
"en": "Average salary divided by the filtered company average"
},
"ai_context": null,
"expression": "AVG({<employees_dataset_id>:<salary_column_id>}) / GROUPFULL(AVG({<employees_dataset_id>:<salary_column_id>}))",
"format": ",.2af",
"id": "a3ad615a-5199-4e58-8e0e-73dceba18af0",
"informat": "numeric",
"lowestLevel": 0,
"name": {
"en": "Salary vs company average"
},
"subtype": null,
"type": "numeric",
"updated_at": "2024-05-20T13:29:37.273Z",
"custom_metadata": null,
"user_id": "34b22f36-4904-497f-8acf-b0ba1d7e83cb"
}
]
}