Hide a rank on the total row: ISINSCOPE vs HASONEVALUE

RANKX shows a meaningless 1 on the total row. Show the rank only on the matrix’s own rows with ISINSCOPE, and see where HASONEVALUE gets it wrong.

You will learn to

  • Blank a measure on total rows with ISINSCOPE
  • Rank within the slicer selection with ALLSELECTED
  • Explain when HASONEVALUE is TRUE without a row

How it works

Some numbers only make sense on detail rows. A rank is the classic: on the total row, RANKX ranks “all months together” against the months and comes out **1**, which looks like a real result.

Wrap the measure in `IF(ISINSCOPE(column), …)`. With no third argument, IF returns blank on every row where the column isn’t a grouping, which includes the total.

You may have seen `HASONEVALUE` used for this. It answers a different question: “is exactly one value **visible**?”. That is also TRUE when a filter, not the row, narrows things to one value, for example a filter on the month number from the filter pane. Then the “total” shows a rank again. ISINSCOPE asks what you actually mean: “is this column on the rows right now?”.

Practice it hands-on with a real data model and a live report that updates as you type.

Customer Rank = IF(ISINSCOPE(Customer[Customer]), RANKX(ALLSELECTED(Customer[Customer]), [Total Sales]))