AVERAGEA
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 AVERAGEA Function?
The AVERAGEA function in DAX calculates the arithmetic mean of a set of values, including text and logical values. This means that you can use this function to calculate the average of numbers as well as text and logical values like TRUE and FALSE. The AVERAGEA function can also handle blank values.
The syntax for the AVERAGEA function is:
AVERAGEA(❰value1❱, [❰value2❱], ...)
Here, ❰value1❱, ❰value2❱, and so on represent the values that you want to calculate the average of.
How to Use the AVERAGEA Function in Power BI
To use the AVERAGEA function in Power BI, you need to follow these steps:
1. Open Power BI Desktop and create a new report or open an existing one.
2. Click on the “New Measure” button in the “Fields” pane.
3. In the formula bar, type the following formula:
Average Value = AVERAGEA(❰column❱)
Here, ❰column❱ represents the column that you want to calculate the average of. For example, if you want to calculate the average of the “Sales” column, your formula would be:
Average Sales = AVERAGEA(Sales)
4. Press “Enter” to create the measure.
Once you’ve created the measure, you can use it in your visuals like charts and tables. For example, you can create a table that shows the average sales by product category by dragging the “Product Category” column to the “Rows” field and the “Average Sales” measure to the “Values” field.
Examples of Using the AVERAGEA Function
Let’s look at some examples of using the AVERAGEA function in Power BI.
Example 1: Calculating the Average Sales
Suppose you have a sales table that contains the following columns:
– Product Name
– Product Category
– Sales
To calculate the average sales, you can create a measure with the following formula:
Average Sales = AVERAGEA(Sales)
You can then use this measure in your visuals to show the average sales for all products or by product category.
Example 2: Calculating the Average Rating
Suppose you have a product review table that contains the following columns:
– Product Name
– Rating
To calculate the average rating, you can create a measure with the following formula:
Average Rating = AVERAGEA(Rating)
You can then use this measure in your visuals to show the average rating for all products or by product category.
Example 3: Calculating the Average Age
Suppose you have a customer table that contains the following columns:
– Customer Name
– Age
To calculate the average age, you can create a measure with the following formula:
Average Age = AVERAGEA(Age)
You can then use this measure in your visuals to show the average age of your customers.
The AVERAGEA function in DAX is a powerful tool that can help you calculate the arithmetic mean of a set of values, including text and logical values. By following the steps outlined in this article, you can easily use the AVERAGEA function in your Power BI projects to calculate averages of various data types.