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?
Think about how blanks are treated by VALUES and DISTINCT in DAX.
Both VALUES and DISTINCT return unique values from a column, including blanks as a separate row if blanks exist.
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?
Consider which function directly counts unique non-blank values.
DISTINCTCOUNT counts unique non-blank values directly. VALUES and DISTINCT return tables, so COUNTROWS counts rows including blanks. Option A counts rows but excludes blanks.
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?
Think about how VALUES behaves inside CALCULATE with filter context.
VALUES returns the unique values of Products[Category] in the current filter context, so CALCULATE applies a filter for those categories.
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?
Think about how to clean data before applying DISTINCT.
TRIM cannot be used directly inside DISTINCT because DISTINCT expects a column reference. Creating a calculated column with trimmed names cleans data before applying DISTINCT.
What happens when you use VALUES on a table with multiple columns, like VALUES(Sales) where Sales has columns OrderID and ProductID?
Consider how VALUES behaves when given a table instead of a column.
VALUES returns the unique rows of the entire table when used on a table reference, not just a single column.