Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
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.
Thanks in advance for your help !
Solved! Go to Solution.
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:
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.
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:
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.
The top 4 ranked by the points value.
What is your criteria for the TOP 4 rows ?
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 84 | |
| 49 | |
| 38 | |
| 31 | |
| 30 |