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
Haychman
New Member

Various totals in Matrix/table visual

Hi All,

 

I hope everyone is doing well.

 

I have a table which displays the clients and their amounts. I have a seperate table below which calculates (through measures) the total value of top 10 clients,  the total value of clients outside of the top 10, the total value of intercompany clients and 3rd party clients and then the total value of debt.

 

What i'm looking to do is combine the totals in the first table. I would like the table to display (for 3rd party only) the top 10 items by amount, the total outside of the top 10(again for 3rd party only), the total 3rd party, total Intercompany (i.e. items which are not 3rd party) and finally the total of everything in debt.

 

i've written a formula just to make it easier to understand

 

 

Haychman_1-1737548161205.png

 

CategoryDescriptionCodeCalculation
3rd partytop 10W 
3rd partyOtherXX=(Y-W)
3rd partyTotalY 
IntercompanyTotalA 
Grand total BB=(Y+A)

 

 

1 REPLY 1
Sahir_Maharaj
Super User
Super User

Hello @Haychman,

 

Can you please try this approach:

Combined KPI = 
VAR Top10_3rdParty =
    CALCULATE(
        SUM('Debt'[Amount]),
        FILTER(
            'Debt',
            'Debt'[Category] = "3rd Party"
        ),
        TOPN(10, 'Debt', 'Debt'[Amount])
    )
VAR Other_3rdParty =
    CALCULATE(
        SUM('Debt'[Amount]),
        FILTER(
            'Debt',
            'Debt'[Category] = "3rd Party"
        )
    ) - Top10_3rdParty
VAR Total_3rdParty =
    CALCULATE(
        SUM('Debt'[Amount]),
        FILTER(
            'Debt',
            'Debt'[Category] = "3rd Party"
        )
    )
VAR Total_Intercompany =
    CALCULATE(
        SUM('Debt'[Amount]),
        FILTER(
            'Debt',
            'Debt'[Category] = "Intercompany"
        )
    )
VAR Grand_Total =
    Total_3rdParty + Total_Intercompany

RETURN
SWITCH(
    TRUE(),
    ISINSCOPE('Debt'[Category]) && 'Debt'[Category] = "3rd Party" && ISINSCOPE('Debt'[Subcategory]) && 'Debt'[Subcategory] = "Top 10", Top10_3rdParty,
    ISINSCOPE('Debt'[Category]) && 'Debt'[Category] = "3rd Party" && ISINSCOPE('Debt'[Subcategory]) && 'Debt'[Subcategory] = "Other", Other_3rdParty,
    ISINSCOPE('Debt'[Category]) && 'Debt'[Category] = "3rd Party", Total_3rdParty,
    ISINSCOPE('Debt'[Category]) && 'Debt'[Category] = "Intercompany", Total_Intercompany,
    Grand_Total
)

Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ About: https://sahirmaharaj.com/about.html
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

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.