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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
lawada4
Frequent Visitor

total sum value in table visual is wrong

im trying to calculate the total commission by all salespersons. i have 2 tables , one table shows the commission by catgory and the other table shows sales transactions by salespersons.

 

i created a joining column in power query by concatenating 3 columns in the packages table to have 1 unique key in the tabel so that i can join with the other table.

after i joined the two tables with 1 to many relationship and cross filteting

lawada4_1-1673168477285.png

 

then created a table visual that shows :

agent name - categoty-sales-commission value

lawada4_0-1673168427144.png

 

the sales total is correct but the commission is not correct. the commission is taken from the categories commission table and the rest of columns are from the categories transactions table.

the correct total commission should be much higher=973.605

 

any idea of what could lead to wrong total sum value while value per row is correct

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @lawada4 

please try

Total Commission =
SUMX (
SUMMARIZE (
'categories trans',
'categories trans'[AGENT_NAME],
'categories trans'[Category]
),
CALCULATE ( SUM ( 'categories trans'[Commission] ) )
)

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi  @lawada4 ,

Whether your problem has been resolved? If yes, could you please mark the helpful post as Answered? It will help the others in the community find the solution easily if they face the same problem as yours. Thank you.

Best Regards

Anonymous
Not applicable

Hi @tomsmith213 ,

You can create another new measure as below and put this new measure to replace the original measure [Sum of Commission] onto the table visual. Later check if it can return the correct total values...

Sum of Commission = SUM('categories commisions'[Commission']
New Measure =
SUMX (
    GROUPBY (
        'categories trans',
        'categories trans'[AGENT_NAME],
        'categories trans'[Categoty]
    ),
    [Sum of Commission]
)

yingyinr_1-1673329392777.png

 

In addition, you can refer the following links to try to solve your problem...

Why Your Total Is Incorrect In Power BI - The Key DAX Concept To Understand

Dax for Power BI: Fixing Incorrect Measure Totals

 

If the above one can't help you, could you please provide more raw data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples? It would be helpful to find out the solution. You can refer the following links to share the required info:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

And It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

tamerj1
Super User
Super User

Hi @lawada4 

please try

Total Commission =
SUMX (
SUMMARIZE (
'categories trans',
'categories trans'[AGENT_NAME],
'categories trans'[Category]
),
CALCULATE ( SUM ( 'categories trans'[Commission] ) )
)

ValtteriN
Super User
Super User

Hi,

This is a quite common issue. I recommend reading this article to understand the cause of it: Obtaining accurate totals in DAX - SQLBI

Additionally it is generally speaking not a good idea to have a "both" directions realtionship between your tables. Try to change the realationship to "single" between your tables. Additionally if you just want to have total disregarding filters use ALL in your dax. E.g. CALCULATE(SUM(Table[column]),ALL(Table))

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.