This is about the TOPN DAX function, enabling us to see first (last) n rows from table (to do this in visualization, use this tutorial).

Let´s start with this table, containing total revenue for items.

To see first three items with highest revenue, the syntax is:

  • Items with highest revenue = TOPN(
       ‘Table'[Total revenue]; 
But what if we started with table containing not summarized values, like this?
Then we have to add the summarizing function and get three items from table provided by it:
  • Items with highest revenue (2) = topn(
          ‘original data’;
          ‘original data'[Goods];
          “Total revenue”;
          ‘original data'[Revenue]));
       [Total revenue];

Leave a Reply

Your email address will not be published.


clear formPost comment