Skip to content

AVERAGEX

The AVERAGEX function in Infoveave is used to calculate the average of values within a column, taking into account a specified condition defined by the argument.

Applicable to

  • Calculated Columns
  • Expressions

Return Value

The return value of the AVERAGEX function is the sum of values within the dataset or table that satisfy the specified condition.

Remark

  • AVERAGEX is a function that allows you to perform conditional average calculations within datasets.
  • It evaluates the condition for each row in the dataset and includes values that meet the condition.
  • AVERAGEX function cannot be used across date and strings.
  • AVERAGEX function neglects all nulls and blank values.

Syntax

AVERAGEX(<expression>,<condition>)

AVERAGEX in Board Expression

ParameterDescription
ExpressionA placeholder in a function that is replaced with the actual widget and measure names.
ConditionA placeholder in a function that is replaced with the condition filter.
Widget NameThe specific name or identifier of the widget being used for data visualization in the specific Infoboard.
MeasureRepresents the name of the measure that is being displayed or analyzed using the widget.
DimensionRepresents the dimension column that is being displayed or analyzed using the widget.
Dimension ValueRepresents the specific dimension items within the dimension column used for the visualization in the widget.

Steps to Use AVERAGEX

  1. Write the AVERAGEX function. For instance AVERAGEX(<expression>,<condition>)
  2. Where expression equals 'Widget Name'[Measure] and condition equals [Dimension Name]="Dimension Value".Replace Widget Name with the actual name of your widget, Measure with the required measure name, Dimension with the required dimension name and Dimension Value with the dimension value of the selected dimension name.
  3. To learn how to configure an Expression in Infoveave, visit the section Configure Expression.

Scenario You are responsible for managing an Energy Dashboard in Infoveave, and your primary objective is to monitor the average customer numbers on a key performance indicator.

Scenario Details

  • Dashboard Name Energy Dashboard
  • Widget Name Customers
  • Measure Total Customers (quantifying the number of customers)
  • Dimension Discount Types (categorizing customers based on their payment behavior)
  • Dimension Value “Pay on Time” (representing customers who pay their bills on time)

Objective Your objective is to keep track and analyze the performance of solar customers based on their payment behavior. In this scenario, you want to make sure that the average number of customers who have a payment type of “Pay on Time” and ensure that this count exceed 200.

You can use the AVERAGEX function like this

AVERAGEX('Solar Feed In'[Solar Customers], [Discount Type]="Pay on Time") > 200

AVERAGEX in Calculated Columns

ParameterDescription
ExpressionA placeholder in a function that is replaced with the column names.
ConditionA placeholder in a function that is replaced with the condition filter.
Column NameThe name of the column in the dataset or Datasource that contains the values you want to analyze.
Filter ConditionA filter condition returns the data points that meet the defined condition that you want to analyze. The filter condition can be either a string or a numeric.

Steps to Use AVERAGEX in Calculated Columns

  1. Write the AVERAGEX function. For instance AVERAGEX(<expression>,<condition>)
  2. Replace <expression> with required [Column Name] and <condition> equals [Column Name]="Filter Condition"
  3. Replace Column Name with the actual name of your column and Filter Condition with the required condition to be applied on the columns.
  4. To learn how to add calculated columns in Infoveave, visit the section Calculated Columns under Sources.

Objective Consider that you have the below sales dataset, your goal is to find the average UNIT PRICE for the COUNTRY is Brazil.

ORDER DATECOUNTRYCATEGORYUNIT PRICEMARKET PRICEQUANTITY
2024-01-03BrazilBaby Food38.4143.78742
2024-01-07JapanSpices45.5650.815520
Japan43.787410
2024-01-1832.30194
2024-01-22BrazilCosmetics28.33523.01097
2024-01-26Canada20.18523.01099
2024-01-04FranceCereal25.2628.79649
2024-01-09BrazilCereal44.57553.81558
2024-01-14BrazilSnacks20.1854
BrazilCosmetics40.48546.15292

You can use the AVERAGEX function like

AVERAGEX([QUANTITY] , [COUNTRY]="Brazil")

The new calculated column “Unit Sold” will return the total number of rows in the dataset considering nulls and blanks as 34.4

ORDER DATECOUNTRYCATEGORYUNIT PRICEMARKET PRICEQUANTITYAVE UNIT PRICE
03-01-2024BrazilBaby Food38.4143.7874234.4
07-01-2024JapanSpices45.5650.81552034.4
Japan43.78741034.4
18-01-202432.3019434.4
22-01-2024BrazilCosmetics28.33523.0109734.4
26-01-2024Canada20.18523.0109934.4
04-01-2024FranceCereal25.2628.7964934.4
09-01-2024BrazilCereal44.57553.8155834.4
14-01-2024BrazilSnacks20.185434.4
BrazilCosmetics40.48546.1529234.4