0
0
Power BIbi_tool~20 mins

VALUES and DISTINCT in Power BI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
VALUES and DISTINCT Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
dax_lod_result
intermediate
2:00remaining
Difference between VALUES and DISTINCT in DAX

Given a table Sales with a column ProductCategory containing some blank values, what is the result of the following DAX expressions?

1. VALUES(Sales[ProductCategory])
2. DISTINCT(Sales[ProductCategory])

Which statement is true about their outputs?

ABoth return the same unique values including blanks as a separate row.
BVALUES returns unique values including blanks; DISTINCT excludes blanks.
CVALUES returns unique values excluding blanks; DISTINCT includes blanks as a separate row.
DVALUES returns unique values excluding blanks; DISTINCT excludes blanks.
Attempts:
2 left
💡 Hint

Think about how blanks are treated by VALUES and DISTINCT in DAX.

visualization
intermediate
2:00remaining
Visualizing Unique Customers with VALUES vs DISTINCT

You want to create a card visualization showing the count of unique customers from the Orders table. Which DAX measure correctly counts unique customers including those with blank customer IDs?

AUnique Customers = COUNTROWS(VALUES(Orders[CustomerID]))
BUnique Customers = DISTINCTCOUNT(Orders[CustomerID])
CUnique Customers = COUNTROWS(DISTINCT(Orders[CustomerID]))
DUnique Customers = COUNTROWS(FILTER(Orders, NOT(ISBLANK(Orders[CustomerID]))))
Attempts:
2 left
💡 Hint

Consider which function directly counts unique non-blank values.

data_modeling
advanced
2:30remaining
Using VALUES in a Relationship Filter Context

In a model with tables Sales and Products, you write this measure:

Filtered Sales = CALCULATE(SUM(Sales[Amount]), VALUES(Products[Category]))

What does the VALUES function do in this filter context?

AIt causes a syntax error because VALUES cannot be used inside CALCULATE.
BIt returns all unique product categories currently filtered in the report context.
CIt returns a single product category regardless of filters.
DIt returns all product categories ignoring any filters applied.
Attempts:
2 left
💡 Hint

Think about how VALUES behaves inside CALCULATE with filter context.

🔧 Formula Fix
advanced
2:30remaining
Debugging Unexpected Results with DISTINCT

You wrote this measure to get unique product names:

Unique Products = COUNTROWS(DISTINCT(Sales[ProductName]))

But the result is higher than expected because some product names have trailing spaces. Which option best fixes this issue?

AUse TRIM inside DISTINCT: COUNTROWS(DISTINCT(TRIM(Sales[ProductName])))
BReplace DISTINCT with ALL: COUNTROWS(ALL(Sales[ProductName]))
CUse VALUES instead of DISTINCT: COUNTROWS(VALUES(Sales[ProductName]))
DCreate a calculated column with trimmed names and use DISTINCT on it.
Attempts:
2 left
💡 Hint

Think about how to clean data before applying DISTINCT.

🧠 Conceptual
expert
3:00remaining
Understanding VALUES Behavior with Multiple Columns

What happens when you use VALUES on a table with multiple columns, like VALUES(Sales) where Sales has columns OrderID and ProductID?

AVALUES returns a single column table with unique OrderID values.
BVALUES returns unique values only from the first column of Sales.
CVALUES returns a table with unique rows considering all columns in Sales.
DVALUES causes an error because it requires a single column reference.
Attempts:
2 left
💡 Hint

Consider how VALUES behaves when given a table instead of a column.