Returns the average (arithmetic mean) of all the numbers in a column. Handles text and non-numeric values.
What it does? Returns the average (arithmetic mean) of all the numbers in a column. Handles text and non-numeric values. Syntax AVERAGEA([Column]) Returns A decimal number |
What is the AVERAGEA Function?
The AVERAGEA function in DAX is like the inclusive friend who believes everyone should be counted! It takes a set of values, including numbers, text, and logical values, and calculates the average. This is super useful when you want to find the average of mixed data types, ensuring nothing gets left out! This function also treats TRUE as 1 and FALSE as 0.
Example 1: Mixed Data in Sales
Consider you are analyzing sales data, which includes both numeric and non-numeric entries. Here’s how your sales data might look:
Day |
Sales |
Monday |
100 |
Tuesday |
150 |
Wednesday |
TRUE |
Thursday |
200 |
Friday |
FALSE |
To calculate the average, including the logical values, you would use the AVERAGEA function as follows:
Average Smoothies= AVERAGEA(Sales[Sales])
In this case, TRUE is treated as 1 and FALSE as 0. The calculation would be: (100 + 150 + 1 + 200 + 0) / 5 = 90.2.
Example 2: Student Grades
Now, let’s analyze student performance in a class. Your data might look like this:
Student |
Grade |
Nick |
85 |
Emily |
92 |
Jordan |
“Absent” |
Shannen |
88 |
Greg |
TRUE |
To calculate the average grade using AVERAGEA, you would use:
Average Grade = AVERAGEA( [Grades [Grade])
Here, "Absent" is ignored, and TRUE is counted as 1. The calculation would be: (85 + 92 + 0 + 88 + 1) / 5 = 53.2.
Conclusion: Count Everything!
The AVERAGEA function is your trusty ally for calculating averages when dealing with mixed data types, whether it’s snack sales, class grades, or anything else that needs an inclusive approach. With just a simple function, you can turn diverse values into meaningful insights.
So, what are you waiting for? Get averaging with AVERAGEA and ensure every value counts!