AVERAGE
What it does?
Returns the average (arithmetic mean) of all the numbers in a column.
Syntax
AVERAGE([Column])
Returns
A decimal number
What is the AVERAGE Function?
The AVERAGE function in DAX is like the wise friend who helps you find the middle ground! It takes a set of numbers and calculates the average, giving you a clear picture of your data. Perfect for when you want to know the typical sales amount or how well your favorite player is performing on average!
Example 1: Smoothie Stand Stats
Imagine you run a smoothie stand, and you want to know the average number of smoothies sold over a week. Here’s how your sales data might look:
Day |
Smoothies Sold |
Monday |
50 |
Tuesday |
70 |
Wednesday |
60 |
Thursday |
90 |
Friday |
80 |
To find the average number of smoothies sold, you’d use the AVERAGE function like this:
Average Smoothies= AVERAGE(Sales[Smoothies Sold])
So, what’s your average? Adding them up gives you 50 + 70 + 60 + 90 + 80 = 350, and dividing by 5 days gives you 70 smoothies sold on average each day! Time to celebrate with a refreshing smoothie!
You might see some people place single quotes around tables like 'Sales Quota'. This does not hurt or help the processing of your DAX code.
Example 2: Game On!
Now, let’s say you’re tracking your basketball team’s scores over the last five games. Here’s how the scores might look:
Game |
Points Scored |
Game 1 |
82 |
Game 2 |
95 |
Game 3 |
78 |
Game 4 |
88 |
Game 5 |
92 |
To find out the average score, you’d use the function like this:
Average Score = AVERAGE(Games[Points Scored])
Calculating the average, you add them up: 82 + 95 + 78 + 88 + 92 = 435. Dividing by 5 games gives you an average score of 87 points per game! Time for a victory dance!
Conclusion: Find the Middle!
The AVERAGE function is your go-to buddy for finding the typical value in your data, whether its smoothies sold, game scores, or anything else. With just a simple function, you can turn numbers into insights and make your reports meaningful.
So, what are you waiting for? Get averaging and discover the magic of middle ground!