You have a table Sales with columns ProductCategory and SalesAmount. You want to create a calculated column CategoryRank that ranks each sale within its product category by sales amount, highest first.
Which DAX formula correctly uses EARLIER to achieve this?
Remember, EARLIER refers to the current row's value in a nested row context.
Option A correctly uses EARLIER to compare each row's ProductCategory and SalesAmount to the current row, counting how many sales have equal or higher sales amount in the same category, producing a rank.
Option A uses RANKX but incorrectly uses EARLIER inside FILTER which is invalid here.
Option A compares columns to themselves without EARLIER, so it does not create a proper row context.
Option A ranks in ascending order, which is opposite of the requirement.
In DAX, what does the EARLIER function do when used inside nested row contexts?
Think about how nested loops work in programming.
EARLIER allows you to access the value of a column from an outer row context when you have nested row contexts, like nested loops. This is useful to compare the current row with other rows.
Consider this calculated column formula:
Rank = COUNTROWS(FILTER(Sales, Sales[ProductCategory] = EARLIER(Sales[ProductCategory]) && Sales[SalesAmount] > Sales[SalesAmount]))
What error or issue will this formula cause?
Check how the comparison is made inside the FILTER.
The formula compares Sales[SalesAmount] to itself without EARLIER on the right side, so the condition Sales[SalesAmount] > Sales[SalesAmount] is always false. This causes the filter to return no rows, so the count is always zero.
You have a Sales table with columns CustomerID, OrderDate, and SalesAmount. You want to add a calculated column CumulativeSales that shows the total sales amount for each customer up to and including the current order date.
Which DAX formula correctly uses EARLIER to calculate this cumulative sales?
Use FILTER inside CALCULATE with EARLIER to compare current row values.
Option D correctly filters the Sales table to rows with the same CustomerID and order dates up to the current row's date, then sums the sales amounts.
Option D lacks EARLIER and does not create proper row context.
Option D has incorrect syntax inside CALCULATE filter argument.
Option D incorrectly adds current sales amount to total sales without filtering.
You created a calculated column CategoryRank using EARLIER to rank sales within each product category. You want to build a Power BI report page that clearly shows:
- Product categories on the Y-axis
- Sales amounts as bars
- CategoryRank as data labels on each bar
Which visualization and settings best follow best practices for clarity and accessibility?
Think about which chart type best shows ranking and sales amount clearly.
Option B uses a clustered bar chart which is good for comparing categories. Showing CategoryRank as data labels directly on bars helps users see rank clearly. High contrast colors and alt text improve accessibility.
Option B's pie chart is not ideal for ranking and can be confusing with many categories.
Option B's stacked column chart mixes rank and amount in a confusing way without labels.
Option B's table lacks visual impact and accessibility enhancements.