MIN and MAX in Power BI - Real Business Scenario
| Date | Product Category | Sales Amount |
|---|---|---|
| 2024-01-15 | Electronics | 1200 |
| 2024-02-10 | Electronics | 1500 |
| 2024-03-05 | Electronics | 1100 |
| 2024-01-20 | Clothing | 500 |
| 2024-02-15 | Clothing | 700 |
| 2024-03-10 | Clothing | 650 |
| 2024-01-25 | Home Goods | 800 |
| 2024-02-20 | Home Goods | 900 |
| 2024-03-15 | Home Goods | 850 |
Use Power BI filter on Date column: Date >= DATE(2024,1,1) and Date <= DATE(2024,3,31)Min Sales = MIN('Sales'[Sales Amount])Max Sales = MAX('Sales'[Sales Amount])Table visual configuration: Rows = 'Sales'[Product Category], Values = Min Sales, Max SalesProduct Category | Min Sales | Max Sales -----------------|-----------|---------- Electronics | 1100 | 1500 Clothing | 500 | 700 Home Goods | 800 | 900
Create a visual that shows the minimum and maximum sales amounts over time for each product category.
Practice
What does the MIN function do in Power BI?
Solution
Step 1: Understand the purpose of MIN
The MIN function is designed to find the smallest value in a column of data.Step 2: Compare with other functions
Unlike MAX which finds the largest, MIN specifically returns the smallest value.Final Answer:
It returns the smallest value in a column. -> Option AQuick Check:
MIN = smallest value [OK]
- Confusing MIN with MAX
- Thinking MIN counts rows
- Assuming MIN sums values
Which of the following is the correct syntax to find the maximum value in a column named Sales[Amount] using DAX?
Solution
Step 1: Recall correct DAX function name
The correct function to find the largest value is MAX, not MAXIMUM or MAX_VALUE.Step 2: Check column reference syntax
In DAX, columns are referenced as TableName[ColumnName], so Sales[Amount] is correct.Final Answer:
MAX(Sales[Amount]) -> Option AQuick Check:
MAX + [Column] syntax [OK]
- Using wrong function names like MAXIMUM
- Using dot notation instead of brackets
- Adding extra words in function name
Given the table Sales with Amount values: 100, 250, 75, 300, what is the result of MIN(Sales[Amount]) and MAX(Sales[Amount])?
Solution
Step 1: Identify smallest value in Amount column
The values are 100, 250, 75, 300. The smallest is 75.Step 2: Identify largest value in Amount column
The largest value among these is 300.Final Answer:
MIN = 75, MAX = 300 -> Option DQuick Check:
MIN = 75, MAX = 300 [OK]
- Mixing up smallest and largest values
- Assuming zero is minimum without data
- Ignoring actual data values
What is wrong with this DAX expression to find the minimum sales amount?MIN(Sales.Amount)
Solution
Step 1: Check column reference syntax
DAX requires columns to be referenced as TableName[ColumnName], not TableName.ColumnName.Step 2: Validate function usage
MIN is valid for numeric columns, so the function is correct but the syntax is wrong.Final Answer:
The table and column should be referenced with brackets, not dot notation. -> Option BQuick Check:
Use brackets for columns in DAX [OK]
- Using dot notation instead of brackets
- Confusing MIN with MAX
- Thinking MIN can't be used on numbers
You have a sales table with columns Region and SalesAmount. You want to create a measure that shows the maximum sales amount only for the East region. Which DAX expression is correct?
A) MAX(Sales[SalesAmount])
B) CALCULATE(MAX(Sales[SalesAmount]), FILTER(Sales[Region] = "East"))
C) MAXX(FILTER(Sales, Sales[Region] = "East"), Sales[SalesAmount])
D) MIN(Sales[SalesAmount])
Solution
Step 1: Understand filtering by region
We want the max sales amount only for the East region, so we must filter the table to East.Step 2: Evaluate options
MAX(Sales[SalesAmount]) returns max for all regions.
CALCULATE(MAX(Sales[SalesAmount]), FILTER(Sales[Region] = "East")) uses FILTER incorrectly; FILTER requires a table as the first argument followed by a condition.
MAXX(FILTER(Sales, Sales[Region] = "East"), Sales[SalesAmount]) correctly filters Sales to East and then finds max SalesAmount.
MIN returns minimum, not maximum.Final Answer:
MAXX(FILTER(Sales, Sales[Region] = "East"), Sales[SalesAmount]) -> Option CQuick Check:
Use MAXX + FILTER for conditional max [OK]
- Using MAX without filtering
- Incorrect CALCULATE filter syntax
- Using MIN instead of MAX
Ready to prove it?
Pass the test and this pattern moves unknown
