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! Learn more

Reply
Kaymen
New Member

Customized Total Row (sum of top 4) in table Visualization

Hello,

 

I am looking to get a customized value in the total row for table visualization in Power BI.
I would like the total to be the sum of the top 4 rows only.
Below is a screenshot of the data table and result that I am trying to achieve.

 

Kaymen_2-1699548042822.png

 


Thanks in advance for your help !

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Kaymen ,

You can try the DAX below:

Top4_Sum = 
SUMX(TOPN(4, ALL('Table'[Points]), 'Table'[Points], DESC), 'Table'[Points])

The DAX first sorts the values of the points column from highest to lowest, and then calculates the sum of the first 4 columns.
The results are shown in the figure below:

vjunyantmsft_0-1699845922302.png

 

Best Regards,

Dino Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Kaymen ,

You can try the DAX below:

Top4_Sum = 
SUMX(TOPN(4, ALL('Table'[Points]), 'Table'[Points], DESC), 'Table'[Points])

The DAX first sorts the values of the points column from highest to lowest, and then calculates the sum of the first 4 columns.
The results are shown in the figure below:

vjunyantmsft_0-1699845922302.png

 

Best Regards,

Dino Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Kaymen
New Member

The top 4 ranked by the points value.

AmiraBedh
Super User
Super User

What is your criteria for the TOP 4 rows ?


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Helpful resources

Announcements
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!

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.