AVERAGEX
A
C
- CALCULATE
- CALCULATETABLE
- CALENDAR
- CALENDARAUTO
- CEILING
- CHISQ.DIST
- CHISQ.DIST.RT
- CHISQ.INV
- CHISQ.INV.RT
- CLOSINGBALANCEMONTH
- CLOSINGBALANCEQUARTER
- CLOSINGBALANCEYEAR
- COALESCE
- COLUMNSTATISTICS
- COMBIN
- COMBINA
- COMBINEVALUES
- CONCATENATE
- CONCATENATEX
- CONFIDENCE.NORM
- CONFIDENCE.T
- CONTAINS
- CONTAINSROW
- CONTAINSSTRING
- CONTAINSSTRINGEXACT
- CONVERT
- COS
- COSH
- COT
- COTH
- COUNT
- COUNTA
- COUNTAX
- COUNTBLANK
- COUNTROWS
- COUNTX
- COUPDAYBS
- COUPDAYS
- COUPDAYSNC
- COUPNCD
- COUPNUM
- COUPPCD
- CROSSFILTER
- CROSSJOIN
- CUMIPMT
- CUMPRINC
- CURRENCY
- CURRENTGROUP
- CUSTOMDATA
D
E
I
N
O
P
R
S
- SAMEPERIODLASTYEAR
- SAMPLE
- SEARCH
- SECOND
- SELECTCOLUMNS
- SELECTEDMEASURE
- SELECTEDMEASUREFORMATSTRING
- SELECTEDMEASURENAME
- SELECTEDVALUE
- SIGN
- SIN
- SINH
- SLN
- SQRT
- SQRTPI
- STARTOFMONTH
- STARTOFQUARTER
- STARTOFYEAR
- STDEVX.P
- STDEVX.S
- STDEV.P
- STDEV.S
- SUBSTITUTE
- SUBSTITUTEWITHINDEX
- SUM
- SUMMARIZE
- SUMMARIZECOLUMNS
- SUMX
- SWITCH
- SYD
T
U
What is the AVERAGEX Function?
The AVERAGEX function returns the average of an expression evaluated for each row in a table. It is an iterating function that goes through each row in a table and evaluates the expression provided. The expression can be any valid DAX expression that returns a scalar value, such as a measure or a column. The AVERAGEX function then calculates the average of all these values.
Syntax of the AVERAGEX Function
The syntax for the AVERAGEX function is straightforward. It takes two arguments:
AVERAGEX(table, expression)
– `table`: The table for which you want to calculate the average.
– `expression`: The expression you want to evaluate for each row in the table.
Using the AVERAGEX Function in Power BI
To use the AVERAGEX function in Power BI, follow these steps:
1. Open Power BI and create a new report.
2. Import the data you want to analyze.
3. Create a table or use an existing one.
4. Click on the table to select it.
5. Click on the “New Measure” button in the “Modeling” tab.
6. In the formula bar, enter the AVERAGEX function with the appropriate arguments.
7. Press enter to create the measure.
Example of Using the AVERAGEX Function
Suppose you have a table called “Sales” with columns “Region,” “Product,” and “SalesAmount.” You want to calculate the average sales amount for each region. Here’s how you can use the AVERAGEX function to achieve this:
1. Select the “Sales” table.
2. Click on the “New Measure” button in the “Modeling” tab.
3. In the formula bar, enter the following expression:
RegionAvgSales = AVERAGEX(Sales, Sales[SalesAmount])
4. Press enter to create the measure.
5. Now, you can use this measure in your visualizations to display the average sales amount for each region.
The AVERAGEX function is a powerful tool for data analysis in Power BI. It allows you to calculate the average of an expression evaluated for each row in a table. By following the steps outlined in this article, you can easily use this function to analyze your data and gain valuable insights.