+ Reply to Thread
Results 1 to 14 of 14

Subtotal doesnt match the rows it's totalling?!

  1. #1
    Registered User
    Join Date
    04-29-2021
    Location
    Leicester, England
    MS-Off Ver
    365
    Posts
    45

    Subtotal doesnt match the rows it's totalling?!

    Hi all, I have a power pivot which is showing the distinct count of a set of data. I have subtotals applied but they don't total the row beneath it.

    I've attached an example showing a subtotal of 1,418, but if you add up the rows beneath it they total 1,730 - why would it be different??
    TIA!
    Attached Images Attached Images

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,055

    Re: Subtotal doesnt match the rows it's totalling?!

    Can't tell much from a picture!! Please post an Excel file.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    04-29-2021
    Location
    Leicester, England
    MS-Off Ver
    365
    Posts
    45

    Re: Subtotal doesnt match the rows it's totalling?!

    Quote Originally Posted by Glenn Kennedy View Post
    Can't tell much from a picture!! Please post an Excel file.
    I can't, the data sitting behind it is P&C company data.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,055

    Re: Subtotal doesnt match the rows it's totalling?!

    Delete the stuff that's not needed to demonstrate the issue.

  5. #5
    Registered User
    Join Date
    04-29-2021
    Location
    Leicester, England
    MS-Off Ver
    365
    Posts
    45

    Re: Subtotal doesnt match the rows it's totalling?!

    Quote Originally Posted by Glenn Kennedy View Post
    Delete the stuff that's not needed to demonstrate the issue.
    Ok here it is with everything but the fields making up the totals.
    Attached Files Attached Files

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,055

    Re: Subtotal doesnt match the rows it's totalling?!

    I know what's wrong... but. The Pivot column subtotals are counting DISTINCT policy numbers. There are 1417 of them (after you refresh the Pivot Table). However, the row-by-row list of lines is counting ALL of them... not the distinct ones.

    The BUT is, that using a Pivot Table, I'm not entirely sure how to fix it!! Personally, I hate Pivot Tables and would use a formula to deliver the desired results.

    What VERSION of O365 are you using?

  7. #7
    Registered User
    Join Date
    04-29-2021
    Location
    Leicester, England
    MS-Off Ver
    365
    Posts
    45

    Re: Subtotal doesnt match the rows it's totalling?!

    Quote Originally Posted by Glenn Kennedy View Post
    I know what's wrong... but. The Pivot column subtotals are counting DISTINCT policy numbers. There are 1417 of them (after you refresh the Pivot Table). However, the row-by-row list of lines is counting ALL of them... not the distinct ones.

    The BUT is, that using a Pivot Table, I'm not entirely sure how to fix it!! Personally, I hate Pivot Tables and would use a formula to deliver the desired results.

    What VERSION of O365 are you using?
    I don't think that's it though if you look at the data befind "SUR" for example 19 rows but only 7 distinct policy numbers which is what's shown on the pivot. I'm comfortable with what's shown at the line level, but I can't work out how it's calculating the subtotal of 1,417?

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,055

    Re: Subtotal doesnt match the rows it's totalling?!

    Here's where 1417 comes from:

    =ROWS(UNIQUE(FILTER(Table1[Policy Number],(Table1[Country]="France")*(TEXT(Table1[Renewal Date],"mmm")="Jan"))))

    It selects January from column D,
    ONLY for France
    returns all the policy numbers
    Then returns only the unique onces
    then tells you their number (in effect... the number of rows occupied by that subset).

  9. #9
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,060

    Re: Subtotal doesnt match the rows it's totalling?!

    Create a helper column in your Booking Tracker Table with a formula like =IF(COUNTIF(E$2:E2,E2)=1,1,0), then sum this column in Values field of your PivotTable.

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,055

    Re: Subtotal doesnt match the rows it's totalling?!

    Quote Originally Posted by BH1983 View Post
    I don't think that's it though if you look at the data befind "SUR" for example 19 rows but only 7 distinct policy numbers which is what's shown on the pivot. I'm comfortable with what's shown at the line level, but I can't work out how it's calculating the subtotal of 1,417?
    OK... yes, I see that now.

  11. #11
    Registered User
    Join Date
    04-29-2021
    Location
    Leicester, England
    MS-Off Ver
    365
    Posts
    45

    Re: Subtotal doesnt match the rows it's totalling?!

    Quote Originally Posted by Glenn Kennedy View Post
    OK... yes, I see that now.
    And this is where I'm confused, how can the individiaul rows in the pivot total 1,729 unique policies but the subtotal show 1,417?

  12. #12
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,055

    Re: Subtotal doesnt match the rows it's totalling?!

    Right.... Check Policy 0177538

    It is listed as:

    TECH
    FINANCIAL
    MARINE
    CASUALTY
    FIRE

    So that ONE distince policy is being counted 5 times in the category listing. That's your problem.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    04-29-2021
    Location
    Leicester, England
    MS-Off Ver
    365
    Posts
    45

    Re: Subtotal doesnt match the rows it's totalling?!

    Quote Originally Posted by Glenn Kennedy View Post
    Right.... Check Policy 0177538

    It is listed as:

    TECH
    FINANCIAL
    MARINE
    CASUALTY
    FIRE

    So that ONE distince policy is being counted 5 times in the category listing. That's your problem.
    Ah! so it's counting it once at sub total level, but counted in each of the categories listed below it?

  14. #14
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,055

    Re: Subtotal doesnt match the rows it's totalling?!

    Yep. That's it in a nutshell. You need to think about WHAT totals you actually need.

    If you need more help, shout. If not...

    You're welcome.



    It would be very nice if you were to just click the Add Reputation button at the foot of any of the posts of members who helped you reach a solution.

    Finally, if that takes care of your original question, please click on "Thread Tools" from the menu link (just above the first post in the thread) and mark this thread as SOLVED.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] MATCH function after SUBTOTAL (hidden rows count)
    By LPAM in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 02-27-2023, 09:19 AM
  2. Replies: 1
    Last Post: 08-28-2019, 02:16 PM
  3. [SOLVED] How to get a VLOOKUP+MATCH formula to return 0 and not N/A when MATCH doesnt work
    By Renejorgensen in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-23-2016, 09:40 AM
  4. [SOLVED] Index+Match+Match doesnt returns right values
    By SwissExcel in forum Excel General
    Replies: 10
    Last Post: 07-21-2015, 08:39 AM
  5. Im New...if subtotal exists then remove. if subtotal doesnt exist do nothing
    By ci89 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-30-2015, 04:53 PM
  6. totalling of subtotal values from the listed data
    By balususrinivas in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 04-08-2014, 06:57 AM
  7. Subtotal - Delete zero Subtotal and prior rows that calculate to that zero Subtotal
    By Whatsherface in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-14-2012, 08:37 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1