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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

TOPN Function

Hi, 

 

Can you please help me with something?

 

I have a table that includes the following columns:

1) Tickets ID 

2) Created Time 

3) Account

 

I need to calculate the top 10 customers who raise tickets. 

 

Since they are all in one table - I just tried to use the Top10 feature from the visuals pane filters and it did not work - its showing more than 15 accounts. I tried using the TOPN function - it says "Multiple columns cannot be converted to a scalar value."

 

(i.e) TOP10Accounts = TOPN(10, 'All Tickets', 'All Tickets'[Account],ASC)

 

Can you please help?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Create two measures like and check

CntAccounts = count('All Tickets'[Account])

 

Top 10 City Rank = CALCULATE([CntAccounts],TOPN(10,all('All Tickets'[Account]),[CntAccounts],DESC),VALUES('All Tickets'[Account]))

 

refer to my video : https://www.youtube.com/watch?v=QIVEFp-QiOk

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

@amitchandak  Thank you so much. This worked like a charm. I will try it on my other visuals too to see if it works on all scenarios. The video is very good too!

amitchandak
Super User
Super User

@Anonymous , Create two measures like and check

CntAccounts = count('All Tickets'[Account])

 

Top 10 City Rank = CALCULATE([CntAccounts],TOPN(10,all('All Tickets'[Account]),[CntAccounts],DESC),VALUES('All Tickets'[Account]))

 

refer to my video : https://www.youtube.com/watch?v=QIVEFp-QiOk

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi Amitchandak

Thank you for the video, any chance that you can explain what "VALUES('All Tickets'[Account])" does at the end. I saw your reply in youtube comments, but still don't get it. Any chance you could elebrate more?

Thanks

Charles

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.