How to create a Top 5 measure in Power BI
use TOPN in DAX
Simon Harrison
Although Power BI has an built-in Top N
filter feature
It is often useful to be able to show
that value as a measure and what percent of the whole it represents
This guide shows you how to do it
Step by Step
Create a measure to aggregate sales for
the top 5 products
We create a Variable to identify the top
5 products, and a separate variable to aggregate the sales amount
This makes the DAX easier to follow
We have then used this measure on a card
to highlight how much of the total the top X products represent
We added a simple secondary measure
showing what percentage this is
We then created similar for the bottom 20
products
And Finally added these to the chart
We hope you find this useful
Upvote
Simon Harrison
Business Analytics, with a background in management accounting. 20+ years in Retail, serving a broad range of business with business analytics support, SQL, PowerBI, Excel

Related Articles