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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Guille2711410
Helper I
Helper I

Top 10

Hello I would like to get the top 10 of my collected commissions, but I also want to prevent the number 1 from appearing, since it is not identified.

The formula I use is:

M_Top10 =

      VAR ComPorTipo =

           SUMMARIZE (

                COMT04,

                COMT04 [C76CODCOM],

               "TotCom", SUM (COMT04 [C76IMPRE01]) )

      VAR SumFiltered =

           TOPN(

                10,

                ComPorTipo,

                [TotCom]

            )

      RETURN SumFiltered

However it gives error: "The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value."

I will appreciate your help for these two queries.

Thank you very much

 

3 REPLIES 3
amitchandak
Super User
Super User

@Guille2711410 , Try like

Top 10 City Rank = CALCULATE([Sales],TOPN(10,all(Geography[City]),[Sales],DESC),VALUES(Geography[City Id]))

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

Excellent!!! All ok Thank you very much amitchandak and also for my previous query Guille
mahoneypat
Microsoft Employee
Microsoft Employee

This is an expression that returns a 10-row table, so it will error in a measure expression.  To get the list of your Top 10, you can use CONCATENATEX, but I am not sure if that is what you need.  You can change the Return in your expression to the following.

 

Return CONCATENATEX(SumFiltered, COMT04 [C76CODCOM])

 

If you want to omit the top 1, you can do a TOPN(9, SumFiltered, [TotCom], ASC), and then do CONCATENATEX on that table.

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.