cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
isluwislu
Helper III
Helper III

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 IV
Super User IV

@isluwislu , 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



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

2 REPLIES 2
isluwislu
Helper III
Helper III

@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 IV
Super User IV

@isluwislu , 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



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

March Update

Check it Out!

Click here to read more about the March 2021 Updates!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

secondImage

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.