Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
jenmar2023
Helper I
Helper I

How to display Top 10 by month in a table / matrix

I have a table called Forms.  Within that table, I have a field called forms, Total and YearMonth. 

 

FormsTotalYearMonth
A10202305
B20202305
C25202305
B20202304
A45202304
C5202304

 

I would like my end result to be a table or some visualization where the user can see The top x forms by month.

For the month of April 202304 the top 3 forms were

A, B, then C

For the month of May 202305 the top 3 forms were 

C, B, then A

 

How can I go about creating doing this in PowerBI? Thank you!

5 REPLIES 5
barritown
Super User
Super User

Hi @jenmar2023,

You don't need any DAX here.

All you need is: 

1) Add a slicer.

2) Add a table visual.

3) Open the Filters pane and use the Top filter there for the [Total] column.

4) Enable sorting by [Total].

barritown_0-1692883539223.png

Hope this helps.

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

The user only sees it one month at a time though? They have to select it each month. Is there a way to show it in a table view all at once?

Okay, in this scenario you'll need some DAX.

 

You could create a calculated column like the one below.

barritown_0-1692888278144.png

 

In plain text:

Top3 Flag = 
VAR CurrentMonth = [YearMonth]
VAR Top3 = CONCATENATEX ( TOPN ( 3, FILTER ( Data, [YearMonth] = CurrentMonth ), [Total] ), [Forms], "," )
RETURN CONTAINSSTRING ( Top3, [Forms] )

 

Once you have it, you should set it to True in the filter pane and sort your table by 2 columns holding the Shift key. Like on the screenshot below:

 

barritown_1-1692888391255.png

Best Regards,

Alexander

My YouTube vlog in English

My YouTube vlog in Russian

Didn't work. Can't display the visual when I add Top3 flag

 

Here's the file with the mock data where this solution works - https://www.dropbox.com/scl/fi/bemnu8v7a4ahcbpczew60/community-multiple-topx.pbix?rlkey=5ty9flldoh8t...

Please double check with what you do.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.