Sales = DATATABLE(
"CustomerID", INTEGER,
{ {1}, {2}, {1}, {3}, {2} }
)
-- Which calculated table expression returns unique CustomerIDs?Think about which function returns a table of unique values from a column.
DISTINCT returns a table with unique values from the specified column. VALUES can return unique values but also includes BLANKs and behaves differently with filters. FILTER just filters rows but does not remove duplicates. ALL removes filters but does not guarantee uniqueness.
Think about which chart type best shows trends over time for multiple categories.
A line chart is best to show trends over time for multiple products because it clearly shows changes month by month with separate lines. Stacked columns can be harder to compare trends. Pie charts do not show time trends. Tables show raw data but not trends visually.
Consider which function groups rows and calculates aggregations in a new table.
SUMMARIZE groups the Sales table by Region and Year and adds a new column with the sum of SalesAmount. GROUPBY can do similar but requires SUMX with CURRENTGROUP for aggregation. ADDCOLUMNS adds columns but does not group rows. FILTER only filters rows and does not summarize.
NewTable = FILTER(Sales, Sales[Quantity] > 10, Sales[Price] < 100)
Check the number of arguments FILTER accepts.
FILTER function accepts exactly two arguments: a table and a single filter expression. Passing two separate filter expressions as separate arguments causes a syntax error. To combine conditions, use && inside one filter expression.
Think about what ALLEXCEPT does inside CALCULATE.
ALLEXCEPT removes all filters except the one on CustomerID, so CALCULATE sums SalesAmount for the current CustomerID ignoring other filters. This gives total sales per customer across the dataset.