0
0
Power BIbi_tool~20 mins

Basic arithmetic in DAX in Power BI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
DAX Arithmetic Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
dax_lod_result
intermediate
2:00remaining
Calculate Total Sales with a Simple Arithmetic Expression

You have a table named Sales with columns Quantity and UnitPrice. You want to create a measure that calculates the total sales amount by multiplying quantity by unit price and summing over all rows.

Which DAX expression correctly calculates this total sales amount?

ATotal Sales = SUMX(Sales, Sales[Quantity] * Sales[UnitPrice])
BTotal Sales = SUM(Sales[Quantity]) * SUM(Sales[UnitPrice])
CTotal Sales = SUM(Sales[Quantity] + Sales[UnitPrice])
DTotal Sales = SUMX(Sales, Sales[Quantity] + Sales[UnitPrice])
Attempts:
2 left
💡 Hint

Think about multiplying quantity and price for each row, then adding all results.

visualization
intermediate
2:00remaining
Choose the Best Visualization for Showing Sales Growth Percentage

You have calculated a measure Sales Growth % that shows the percentage increase in sales compared to the previous year. You want to display this on a dashboard for easy comparison across years.

Which visualization type is best suited to clearly show the sales growth percentage over multiple years?

APie Chart showing sales distribution by year
BLine Chart showing Sales Growth % over years
CStacked Bar Chart showing total sales per year
DTable showing sales and sales growth % side by side
Attempts:
2 left
💡 Hint

Think about how to best show trends over time.

data_modeling
advanced
2:00remaining
Create a Calculated Column for Profit Margin Percentage

You have a Sales table with columns Revenue and Cost. You want to add a calculated column that shows the profit margin percentage for each sale.

Which DAX formula correctly creates this calculated column?

AProfit Margin % = (Sales[Revenue] - Sales[Cost]) / Sales[Revenue]
BProfit Margin % = SUM(Sales[Revenue]) - SUM(Sales[Cost]) / SUM(Sales[Revenue])
CProfit Margin % = DIVIDE(Sales[Revenue] - Sales[Cost], Sales[Revenue])
DProfit Margin % = Sales[Revenue] - Sales[Cost] / Sales[Revenue]
Attempts:
2 left
💡 Hint

Use a function that safely handles division by zero.

🔧 Formula Fix
advanced
2:00remaining
Identify the Error in This DAX Measure for Average Price

Consider this DAX measure intended to calculate the average unit price:

Average Price = SUM(Sales[UnitPrice]) / COUNT(Sales[UnitPrice])

What is the main problem with this measure?

AIt will cause a syntax error due to missing parentheses
BIt sums prices instead of summing total sales amount
CIt divides sum of prices by count of prices, which is correct
DIt should use AVERAGE function instead for better performance and accuracy
Attempts:
2 left
💡 Hint

Think about built-in functions for averages.

🧠 Conceptual
expert
2:00remaining
Understanding Evaluation Context in Arithmetic Measures

You create a measure Total Profit = SUM(Sales[Revenue]) - SUM(Sales[Cost]). When you place this measure in a table visual grouped by Region, the profit is calculated per region. But when you use it in a card visual, it shows the total profit for all regions.

Why does the same measure show different results in these visuals?

ABecause the evaluation context changes based on the visual's filters and grouping
BBecause the data model automatically filters the measure only in table visuals
CBecause the measure is recalculated incorrectly in card visuals
DBecause the measure uses different aggregation functions in each visual
Attempts:
2 left
💡 Hint

Think about how filters and grouping affect calculations.