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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
mbosch
Regular Visitor

How to calculate TOPN

Hello.

 

I have the following table:

 

CycleID, UserNAme,CustomerID, score. 

I want to create a formula that sums the top 10 scores within cycleid,username. Any suggestion? I have been trying TOPN but it doesnt work.

 

Thank you

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @mbosch 

 

Is this what you want (I take top 2 as an example)? If not, can you please provide some dummy data and expected result that we can work with? 

Measure = SUMX(TOPN(2, 'Table', 'Table'[Score], DESC), 'Table'[Score])

vjingzhanmsft_0-1707288202332.png

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @mbosch 

 

Is this what you want (I take top 2 as an example)? If not, can you please provide some dummy data and expected result that we can work with? 

Measure = SUMX(TOPN(2, 'Table', 'Table'[Score], DESC), 'Table'[Score])

vjingzhanmsft_0-1707288202332.png

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

mbosch
Regular Visitor

Hello.

 

It doesnt work. It is not summing the top 10. Any alternative?

bhanu_gautam
Super User
Super User

@mbosch , Try using below mentioned method 

 

Top10ScoreSum =
CALCULATE (
SUM ( 'YourTableName'[score] ),
TOPN (
10,
'YourTableName',
'YourTableName'[score],
DESC,
'YourTableName'[CycleID],
'YourTableName'[UserName]
)
)

 

Please accept as solution and give kudos if it helps




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

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.