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?
- A.Best Customer Margin = CALCULATE([Gross Margin], INDEX(-1, ALLSELECTED('Customer'[CustomerName]), ORDERBY([Gross Margin], DESC)))
- B.Best Customer Margin = CALCULATE([Gross Margin], INDEX(2, ALLSELECTED('Customer'[CustomerName]), ORDERBY([Gross Margin], DESC)))
- C.Best Customer Margin = CALCULATE([Gross Margin], INDEX(1, ALLSELECTED('Customer'[CustomerName]), ORDERBY([Gross Margin], DESC)))
- 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
- Reviewing access in the catalog Secure tab
- Shortcut caching for cross-cloud egress
- Open mirroring landing zone for custom sources
- Distinct and conditional counts in KQL
- Converting strings to dates in PySpark
- Warehouse replacements for unsupported types
- Calculated columns in Direct Lake models
- Diagnosing fallback with TABLETRAITS
- Default lakehouse rules for notebooks
- Opening PBIP projects without a pbip file
- Detect data changes in incremental refresh