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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
kwhite0510
Frequent Visitor

Column Total Incorrect

Hi Everyone,

 

I have this equation however, it will not provide a cumlative total. Can someone look at the below DAX Equation and let me know if there is anything I can add or do differently to get it working?

 

Total Agreement Quantity = CALCULATE(Divide('Sales agreements'[Contracted Total],'Sales agreements'[Count rows]))
 
Thank you!
 
Kate
7 REPLIES 7
PhilipTreacy
Super User
Super User

Hi @kwhite0510 

 

You're seeing that total because your measure is working in that cell too.  So, because you are dividing by 'Sales agreements'[Count rows], I'm guessng this value is coming out to all the rows in the table.  Hence the unexpectedly low value.

 

The Total cell doesn't always add up the values above it, in this case it applies the same DAX measure as the rows above it in the column.  It's one of those frustrating annoyances with DAX that is counter-intuitive.

 

If you can provide your data, or at least a snapshot, I can ry fixing this.  At the moment I dno't know what any of your other columns look like.

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Thanks so much @PhilipTreacy Here is some of the data. Let me know if this is enough for you to help revamp the formula.

Total Agreement Quantity = CALCULATE(Divide('Sales agreements'[Contracted Total],'Sales agreements'[Count rows]))

 

Sales agreements'[Contracted Total] - from the equation above this equation is as follows:

Contracted Total = Calculate(SUMX('Sales agreements','Sales agreements'[Agreed quantity line]+'Sales agreements'[Agreed quantity]))
 
Sales agreements'[Count rows]))from the equation above this equation is as follows:
Count rows = Calculate(Countrows('Sales Agreements'),Filter('Sales agreements','Sales agreements'[Agreement number]='Sales agreements'[Agreement number]))
kwhite0510_0-1687290201809.png

 

 
Anonymous
Not applicable

Hi @kwhite0510 ,

 

According to your screenshot, I think you should have hide some other columns in your table visual.

As far as I know, [Contracted Total] and [Count rows] are measures, so there should be some key columns like ID, Category to let your visual expand. You can create a measure measure with correct subtotal.

New Total Agreement Quantity =
SUMX (
    SUMMARIZE (
        'Sales Agreements',
        'Sales Agreements'[Column1 in table visual],
        'Sales Agreements'[Column2 in table visual],
        ...
    ),
    [Total Agreement Quantity]
)

 

Best Regards,
Rico Zhou

 

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

@PhilipTreacy here is some sample data. What I am trying to do is create an total per agreement number. As you can see the numbers are duplicated in the data. Agreement number 6100490 should show in a total column of 25 per each line. 50 is the total but duplicated. Agreement number 6100489 will show 75 per line. But when the total column shows a grand total it should eliminate duplicates. 

 

Hi @kwhite0510 

 

I need the data that those measures use to work, otherwise I have to recreate it all.  Can you post an excerpt of the table(s) as a table, not an image?

 

Regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Agreement NumberAgreed QntyAgreed Qnty LineItem
6100489075123
6100489075124
6100489075125
6100489075126
6100489075127
6100490500127
6100490500126
kwhite0510
Frequent Visitor

Screenshot of the column 

kwhite0510_0-1687211471873.png

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.