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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
YILE
New Member

Top N and others in Matrix The Total only returns Top N total not include the others

Hi 

 

Please see belwo I use Top N to get the top 4 products and others. But in Marix it only calculate Top 4 total not include others. Could anyone help me to include others in Total?

 

YILE_0-1680709643110.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @YILE ,

 

You use the TopN() function and it will total based on the first N rows inside, Other is not in this N row and will not be totaled.

TOPN function (DAX) - DAX | Microsoft Learn

You can use IF+ HASONEVALUE to make a determination

HASONEVALUE function (DAX) - DAX | Microsoft Learn

Here are the steps you can follow:

1. Create measure.

Total =
var _table=
SUMMARIZE(
    'Table','Table'[Product],"Value",[TopN])
return
IF(
    HASONEVALUE('Table'[Product]),
    [TopN],SUMX(_table,[Value]))

2. Result:

vyangliumsft_0-1681196473525.png

 

Best Regards,

Liu Yang

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

 

You use the TopN() function and it will total based on the first N rows inside, Other is not in this N row and will not be totaled.

TOPN function (DAX) - DAX | Microsoft Learn

You can use IF+ HASONEVALUE to make a determination

HASONEVALUE function (DAX) - DAX | Microsoft Learn

Here are the steps you can follow:

1. Create measure.

Total =
var _table=
SUMMARIZE(
    'Table','Table'[Product],"Value",[TopN])
return
IF(
    HASONEVALUE('Table'[Product]),
    [TopN],SUMX(_table,[Value]))

2. Result:

vyangliumsft_0-1681196473525.png

 

Best Regards,

Liu Yang

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

Thank you so much!

amitchandak
Super User
Super User

@YILE , refer if this can help

Power BI- TOPN with Others- https://youtu.be/I_TY4hVlzAE

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

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.