CertKeen

Fabric Analytics Engineer (DP-600) · Free practice question 7 of 12

Top item value with the INDEX function

A card visual must display the gross margin of the most profitable customer among the customers currently selected by the report's slicers. Which measure uses a DAX window function to return this value?

  1. A.Best Customer Margin = CALCULATE([Gross Margin], INDEX(-1, ALLSELECTED('Customer'[CustomerName]), ORDERBY([Gross Margin], DESC)))
  2. B.Best Customer Margin = CALCULATE([Gross Margin], INDEX(2, ALLSELECTED('Customer'[CustomerName]), ORDERBY([Gross Margin], DESC)))
  3. C.Best Customer Margin = CALCULATE([Gross Margin], INDEX(1, ALLSELECTED('Customer'[CustomerName]), ORDERBY([Gross Margin], DESC)))
  4. D.Best Customer Margin = CALCULATE([Gross Margin], INDEX(1, ALL('Customer'[CustomerName]), ORDERBY('Customer'[CustomerName], ASC)))
Show answer and explanation

Correct answer: C. Best Customer Margin = CALCULATE([Gross Margin], INDEX(1, ALLSELECTED('Customer'[CustomerName]), ORDERBY([Gross Margin], DESC)))

Why: INDEX returns the row at an absolute position in a relation, so position 1 with customers ordered by gross margin descending is the most profitable selected customer, and CALCULATE evaluates the measure for that customer. Position -1 counts from the end and returns the least profitable customer, and position 2 returns the runner-up. Ordering every customer alphabetically returns the first name in the list and ignores the slicer selection.

More free Fabric Analytics Engineer (DP-600) questions