Returns the largest value in a column, or between two scalar expressions.
Quick Coach Video
|
What it does? Returns the largest value in a column, or between two scalar expressions. Syntax MAX( <column>) MAX(<expression1>, <expression2>) Returns The largest value. |
What is the MAX Function?
The MAX function in DAX is like the judge at a talent show—it determines who shines the brightest by finding the highest value in a set! Whether you’re looking for the highest score in a game or the maximum sales in a month, MAX is your go-to function for pinpointing that top performer!
Example 1: Highest Plant Height
Imagine you’re a dedicated gardener, and you want to find out which plant has grown the tallest in your garden this season. Here’s how your plant height data might look:
Plant Name |
Height (cm) |
Sunflower |
150 |
Tomato |
80 |
Cucumber |
120 |
Zucchini |
90 |
To find the tallest plant, you’d use the MAX function like this:
Tallest Plant Height = MAX(GardenData[Height (cm)])
So, which plant reached the highest? The tallest plant is 150 cm! 🌻📏
Example 2: Monthly Sales Performance
Now, let’s say you run a small business and want to find out the highest sales made in a month. Your sales data might look like this:
Month |
Sales Amount |
January |
2,500 |
February |
3,000 |
March |
4,200 |
April |
3,800 |
To find the maximum sales for the month, you would use the MAX function like this:
Highest Monthly Sales = MAX(MonthlySales[Sales Amount])
So, what was the best sales month? The highest sales amount is 4,200! 💰📈
Example 3: Latest Project Deadline
Imagine you're managing a series of projects and you want to find out the latest deadline for any of your projects. Here’s how your project deadline data might look:
Project Name |
Deadline |
Project Alpha |
09-15-2024 |
Project Beta |
10-1-2024 |
Project Gamma |
10-9-2024 |
Project Delta |
10-5-2024 |
Total Calculation:
- Project Alpha: 2024-09-15 (counted)
- Project Beta: 2024-10-01 (counted)
- Project Gamma: 2024-09-10 (counted)
- Project Delta: 2024-10-05 (counted)
So, what’s the latest project deadline? It’s 2024-10-05! 📅✨
Conclusion: Max It Out!
The MAX function in DAX is your reliable partner for finding the top value in your data. Whether it’s the tallest plant in your garden or the best sales performance, MAX helps you identify the standout achievements!
So, what are you waiting for? Let’s start maximizing those values with the MAX function! 🥳