DAX stands for Data Analysis Expressions. It is a formula language used in Power BI to create custom calculations and measures.
Click to reveal answer
beginner
How do you add two columns in DAX?
You use the plus sign (+) to add two columns or values. For example: Total Sales = Sales[Price] + Sales[Tax].
Click to reveal answer
beginner
Which symbol is used for multiplication in DAX?
The asterisk (*) is used for multiplication. For example: Total Cost = Sales[Quantity] * Sales[UnitPrice].
Click to reveal answer
intermediate
What happens if you divide by zero in DAX?
Dividing by zero causes an error. To avoid this, use functions like DIVIDE() which safely handle division by zero.
Click to reveal answer
beginner
Write a DAX formula to calculate the difference between two columns: Sales[Revenue] and Sales[Cost].
You can write: Profit = Sales[Revenue] - Sales[Cost]. This subtracts Cost from Revenue to get Profit.
Click to reveal answer
Which symbol is used for subtraction in DAX?
A-
B/
C*
D+
✗ Incorrect
The minus sign (-) is used for subtraction in DAX.
What does this DAX expression do? Total = Sales[Price] * Sales[Quantity]
AAdds Price and Quantity
BMultiplies Price by Quantity
CDivides Price by Quantity
DSubtracts Quantity from Price
✗ Incorrect
The asterisk (*) multiplies Price by Quantity.
How can you safely divide two columns in DAX to avoid errors?
AUse the DIVIDE() function
BUse the + operator
CUse the / operator directly
DUse the * operator
✗ Incorrect
DIVIDE() handles division by zero safely.
What is the result of 5 + 3 * 2 in DAX?
A13
B16
C10
D11
✗ Incorrect
Multiplication has higher priority, so 3*2=6, then 5+6=11.
Which of these is NOT a basic arithmetic operator in DAX?
A+
B-
C%
D*
✗ Incorrect
The percent sign (%) is not a basic arithmetic operator in DAX.
Explain how to perform basic arithmetic operations in DAX with examples.
Think about how you add or multiply numbers in math class.
You got /3 concepts.
Describe how to handle division by zero errors in DAX calculations.
Consider what happens if you try to divide by zero on a calculator.
You got /3 concepts.
Practice
(1/5)
1. What does the DAX expression Total Sales = SUMX(Sales, Sales[Quantity] * Sales[Price]) calculate?
easy
A. The division of quantity by price
B. The sum of quantity and price
C. The difference between quantity and price
D. The total sales amount by multiplying quantity and price
Solution
Step 1: Understand the multiplication operator in DAX
The asterisk (*) symbol multiplies two numbers or columns in DAX.
Step 2: Analyze the expression components
SUMX(Sales, Sales[Quantity] * Sales[Price]) iterates over Sales table, multiplies Quantity and Price row-by-row, and sums the results.
Final Answer:
The total sales amount by multiplying quantity and price -> Option D
Quick Check:
Quantity * Price = Total Sales [OK]
Hint: Multiply quantity and price to get total sales [OK]
Common Mistakes:
Confusing multiplication with addition
Using division instead of multiplication
Ignoring the column context in calculation
2. Which of the following is the correct syntax to create a new measure that subtracts Discount from TotalPrice in DAX?
easy
A. NewMeasure = TotalPrice + Discount
B. NewMeasure := TotalPrice - Discount
C. NewMeasure = TotalPrice - Discount
D. NewMeasure - TotalPrice - Discount
Solution
Step 1: Recall the correct assignment operator in DAX
DAX uses the equals sign (=) to assign expressions to measures.
Step 2: Check the arithmetic operator for subtraction
The minus sign (-) subtracts one value from another.
Final Answer:
NewMeasure = TotalPrice - Discount -> Option C
Quick Check:
Use '=' for assignment and '-' for subtraction [OK]
Hint: Use '=' to assign and '-' to subtract in DAX [OK]
Common Mistakes:
Using ':=' instead of '=' for measure assignment
Using '+' instead of '-' for subtraction
Missing the assignment operator
3. Given the DAX measure: Profit = SUM(Sales[Revenue]) - SUM(Sales[Cost]) and the Sales table has Revenue = 1000 and Cost = 700, what is the value of Profit?
Hint: Subtract total cost from total revenue to get profit [OK]
Common Mistakes:
Adding instead of subtracting
Using individual row values instead of sums
Confusing Revenue and Cost columns
4. Identify the error in this DAX measure: NetAmount = SUM(Sales[Amount]) + - SUM(Sales[Discount])
medium
A. No error, the syntax is correct
B. Missing parentheses around SUM functions
C. SUM function cannot be used with columns
D. Incorrect use of '+ -' operators together
Solution
Step 1: Analyze the operator usage
The '+ -' uses unary minus after addition, which is valid in DAX.
Step 2: Verify the expression
SUM(Sales[Amount]) + (-SUM(Sales[Discount])) correctly computes net amount as Amount minus Discount.
Final Answer:
No error, the syntax is correct -> Option A
Quick Check:
SUM(Amount) + -SUM(Discount) = Net Amount [OK]
Hint: '+ -' is valid unary minus for subtraction [OK]
Common Mistakes:
Thinking '+ -' is invalid syntax
Assuming parentheses are always required around SUM
Thinking SUM can't be used on columns
5. You want to create a measure that calculates the average price after applying a 10% discount on the Price column. Which DAX expression correctly applies this?
hard
A. AvgDiscountedPrice = AVERAGEX(Sales, Sales[Price] * 0.9)
B. AvgDiscountedPrice = AVERAGE(Sales[Price] * 0.9)
C. AvgDiscountedPrice = SUM(Sales[Price * 0.9]) * 0.9 / COUNT(Sales[Price])
D. AvgDiscountedPrice = SUM(Sales[Price] * 0.9) / COUNT(Sales[Price])
Solution
Step 1: Understand the requirement
We need the average of prices after applying a 10% discount on each price (row context).
Step 2: Analyze each option
Averaging requires row-by-row computation for expressions: AVERAGEX(Sales, Sales[Price] * 0.9) correctly iterates and averages discounted prices. A, C, and D have syntax errors (aggregate on expression without iterator or invalid column reference).
Final Answer:
AvgDiscountedPrice = AVERAGEX(Sales, Sales[Price] * 0.9) -> Option A
Quick Check:
Use AVERAGEX for average of row expressions [OK]
Hint: Apply discount inside AVERAGEX to get correct result [OK]
Common Mistakes:
Using AVERAGE on expression without iterator
Using SUM and COUNT instead of AVERAGEX
Invalid column references like [Price * 0.9]
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.