Interactive Problem Catalog

DAX Practice Challenges

Solve real analytical problems, get instant deterministic feedback, and earn XP.

Solved0 / 47
Topic:
beginner
+50 XP

Calculate Total Revenue

SUM Aggregation

Create a measure that sums the total Revenue from the Sales table.

Solve Challenge
beginner
+50 XP

Total Units Sold

SUM Aggregation

Create a measure named 'Total Quantity' to calculate the sum of Quantity sold in the Sales table.

Solve Challenge
beginner
+50 XP

Count Total Transactions

COUNTROWS

Create a measure 'Total Transactions' that counts the total number of rows in the Sales table using the recommended best practice function.

Solve Challenge
beginner
+50 XP

Unique Active Customers

DISTINCTCOUNT

Create a measure 'Active Customers' that calculates the count of unique CustomerIDs appearing in the Sales table.

Solve Challenge
beginner
+50 XP

Average Transaction Revenue

AVERAGE

Create a measure 'Average Sale Value' that calculates the arithmetic mean of Revenue in the Sales table.

Solve Challenge
beginner
+50 XP

Total Cost of Goods

SUM Aggregation

Create a measure 'Total Cost' calculating the sum of the Cost column from the Sales table.

Solve Challenge
beginner
+50 XP

Highest Priced Product

MAX Function

Create a measure 'Max Product Price' to find the highest unit price in the Products catalog.

Solve Challenge
beginner
+50 XP

Earliest Recorded Order Date

MIN on Dates

Create a measure 'First Sale Date' that determines the earliest Date in the Sales table.

Solve Challenge
beginner
+50 XP

Total Customer Count

COUNTROWS Dimensional

Create a measure 'Total Customers' counting the total number of registered customers in the Customers table.

Solve Challenge
beginner
+50 XP

Safe Average Order Value

DIVIDE

Calculate 'Average Order Value' by dividing [Total Revenue] by [Total Transactions] using the safe DIVIDE function with a 0 fallback.

Solve Challenge
intermediate
+100 XP

Enterprise Segment Revenue

CALCULATE Filter Context

Create a measure 'Enterprise Revenue' that calculates total revenue specifically where Customers[Segment] equals 'Enterprise'.

Solve Challenge
intermediate
+100 XP

Global Grand Total (ALL)

ALL Filter Modifier

Create a measure 'All Sales Revenue' that computes total sales revenue across the entire dataset, ignoring any filters on the Sales table.

Solve Challenge
intermediate
+100 XP

Revenue Share %

Percentage of Total

Calculate 'Revenue Contribution %' by dividing the filtered [Total Revenue] by the grand total revenue using ALL(Sales).

Solve Challenge
intermediate
+100 XP

United States Revenue Only

Related Dimension Filter

Create a measure 'US Sales' that calculates total revenue where Customers[Country] = 'United States'.

Solve Challenge
intermediate
+100 XP

High Value Transactions Filter

FILTER Table Iterator

Create a measure 'High Value Revenue' that sums Sales[Revenue] for transactions where Sales[Revenue] > 2000 using the FILTER function.

Solve Challenge
intermediate
+100 XP

Software Category Sales

Product Dimension Filter

Create a measure 'Software Sales' that calculates total revenue where Products[Category] is 'Software'.

Solve Challenge
intermediate
+100 XP

Removing Product Filters with REMOVEFILTERS

REMOVEFILTERS

Create a measure 'Sales All Products' calculating [Total Revenue] while clearing any filters on the Products table using REMOVEFILTERS.

Solve Challenge
intermediate
+100 XP

Multiple Filter Conditions

Multiple Filters in CALCULATE

Create a measure 'Corporate US Sales' for transactions where Customers[Country] = 'United States' AND Customers[Segment] = 'Corporate'.

Solve Challenge
intermediate
+120 XP

Preserving Filters with KEEPFILTERS

KEEPFILTERS

Create a measure 'Kept Enterprise Sales' that uses KEEPFILTERS around Customers[Segment] = 'Enterprise' so existing slicers are intersected rather than replaced.

Solve Challenge
intermediate
+100 XP

Clearing Single Column with ALL

Column-Level ALL

Create a measure 'Sales Across Segments' that removes filters exclusively from Customers[Segment] while preserving filters on Country and Product.

Solve Challenge
intermediate
+100 XP

Calculate Total Margin with SUMX

SUMX Row Context

Create a measure 'Total Margin' using SUMX to iterate through Sales and compute (Sales[Revenue] - Sales[Cost]) row-by-row.

Solve Challenge
intermediate
+120 XP

Average Customer Revenue

AVERAGEX & Context Transition

Calculate 'Average Customer Revenue' by iterating through the Customers table and evaluating [Total Revenue] for each customer.

Solve Challenge
intermediate
+100 XP

Count High Volume Transactions with COUNTX

COUNTX

Use COUNTX over Sales to count rows where Quantity is at least 3.

Solve Challenge
intermediate
+100 XP

Max Spend by Customer

MAXX

Create a measure 'Max Customer Spend' using MAXX across Customers evaluating [Total Revenue].

Solve Challenge
intermediate
+120 XP

Extended Price Calculation with RELATED

SUMX with RELATED

Calculate 'Total Gross Revenue' by multiplying Sales[Quantity] by the product's catalog price Products[Price] using RELATED inside SUMX.

Solve Challenge
intermediate
+120 XP

Minimum Non-Zero Margin

MINX with Filter

Find the lowest positive transaction margin using MINX on Sales where Revenue > Cost.

Solve Challenge
intermediate
+120 XP

Average Daily Revenue

AVERAGEX over Date

Create a measure 'Average Daily Sales' by averaging [Total Revenue] across all Date[Date] rows.

Solve Challenge
intermediate
+100 XP

Concatenate Top Customer Names

CONCATENATEX

Create a measure 'Customer List' that joins customer names with a comma delimiter using CONCATENATEX.

Solve Challenge
intermediate
+100 XP

Year-To-Date Revenue

TOTALYTD

Create a measure 'Revenue YTD' calculating the cumulative year-to-date total of [Total Revenue] using the Date[Date] calendar column.

Solve Challenge
intermediate
+100 XP

Prior Year Revenue

SAMEPERIODLASTYEAR

Calculate 'Revenue Prior Year' using CALCULATE and SAMEPERIODLASTYEAR on the Date[Date] column.

Solve Challenge
advanced
+150 XP

Year-Over-Year Growth %

YoY Growth Pattern

Calculate 'YoY Growth %' using variables: Current Sales, Prior Year Sales, and safe division.

Solve Challenge
intermediate
+100 XP

Previous Month Sales with DATEADD

DATEADD Month Shift

Create 'Sales Previous Month' using DATEADD to shift the Date[Date] column back by 1 MONTH.

Solve Challenge
intermediate
+100 XP

Quarter-To-Date Sales

TOTALQTD

Create a measure 'Revenue QTD' calculating cumulative sales for the current quarter using TOTALQTD.

Solve Challenge
intermediate
+100 XP

Month-Over-Month Change

MoM Growth Variance

Create a measure 'MoM Revenue Change' that computes the numerical difference between [Total Revenue] and the previous month's revenue.

Solve Challenge
advanced
+150 XP

Rolling 30-Day Revenue

DATESINPERIOD

Create a measure 'Rolling 30 Days Revenue' using CALCULATE, [Total Revenue], and DATESINPERIOD starting from MAX(Date[Date]) for -30 days.

Solve Challenge
advanced
+150 XP

Full Year Rest of Prior Year with PARALLELPERIOD

PARALLELPERIOD

Use PARALLELPERIOD with -1 and YEAR to get the entire prior year's revenue regardless of which month is currently filtered.

Solve Challenge
intermediate
+100 XP

Customer Segment Title with SELECTEDVALUE

SELECTEDVALUE

Create a measure 'Report Header' displaying 'Sales for ' concatenated with the selected Customer segment, defaulting to 'All Customers'.

Solve Challenge
intermediate
+120 XP

Customer Tiering with SWITCH(TRUE())

SWITCH TRUE Pattern

Classify performance based on [Total Revenue]: over 10000 -> 'Platinum', over 5000 -> 'Gold', otherwise -> 'Silver'.

Solve Challenge
advanced
+150 XP

Customer Rank by Revenue with RANKX

RANKX

Create a measure 'Customer Sales Rank' that ranks customers by [Total Revenue] across ALL(Customers).

Solve Challenge
intermediate
+100 XP

Clean Variables Pattern

VAR RETURN Debugging

Calculate Profit Margin % using clean variables for Rev, Cost, Margin, and safe DIVIDE.

Solve Challenge
advanced
+150 XP

Dynamic Measure Selection

SWITCH with Parameter

Build a dynamic measure that returns [Total Revenue] if selected parameter is 'Revenue', [Total Quantity] if 'Quantity', else [Total Cost].

Solve Challenge
intermediate
+100 XP

Safe Coalesce for Missing Data

COALESCE

Return the customer's phone or contact if present, falling back to 'No Contact Listed' using COALESCE.

Solve Challenge
advanced
+150 XP

Top 5 Customers Revenue with TOPN

TOPN Virtual Table

Calculate the total revenue generated exclusively by the top 5 customers using CALCULATE and TOPN.

Solve Challenge
advanced
+150 XP

Distinct Active Products with VALUES

VALUES Table

Count how many products have recorded sales in the current filter context using COUNTROWS(VALUES(Sales[ProductID])).

Solve Challenge
advanced
+150 XP

Virtual Table Aggregation with SUMMARIZE

SUMMARIZE & SUMX

Calculate average revenue per country by iterating over a SUMMARIZE table of Countries using AVERAGEX.

Solve Challenge
advanced
+150 XP

Context Transition in Calculated Columns

Context Transition

Explain and demonstrate context transition: wrap SUM(Sales[Revenue]) inside CALCULATE so a row context becomes a filter context.

Solve Challenge
advanced
+150 XP

Dynamic Disconnected Slicer Treatment with TREATAS

TREATAS Virtual Lineage

Apply a virtual relationship between an unlinked selection and Products[Category] using TREATAS.

Solve Challenge