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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
v-yiruan-msft
Community Support
Community Support

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

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-yiruan-msft
Community Support
Community Support

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

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors