+ Reply to Thread
Results 1 to 10 of 10

Calculating data in pivots

  1. #1
    Registered User
    Join Date
    09-10-2020
    Location
    Zeeland, Netherlands
    MS-Off Ver
    2013
    Posts
    13

    Calculating data in pivots

    I am trying to calculate data in a pivottable but cannot get the right %compliance.
    calculation should be something like Due/ (Due+overdue) but how do i count the due and the total from my data source or in my pivot based on itemid.

    Who can help me with this problem.
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    10-30-2019
    Location
    Bistrita, Romania
    MS-Off Ver
    2019; 365
    Posts
    231

    Re: Calculating data in pivots

    Wouldn't it be possible to use 1 and 0 instead of Y and N for Overdue?
    Cause then you could sum the 1 to find the number of Overdues, then the difference between total count and that sum of 1s would be the Not-Overdue.

    As far as I know count / countif formulas don't work in Pivot.
    Don't know about PowerPivot (never used).
    To show your appreciation
    Click ★ Add reputation!

  3. #3
    Registered User
    Join Date
    09-10-2020
    Location
    Zeeland, Netherlands
    MS-Off Ver
    2013
    Posts
    13

    Re: Calculating data in pivots

    the report is generated from website/ database. i guess we can rename the Y and N into numbers. that then needs to ben done somewhere before pivot is made.

  4. #4
    Forum Contributor
    Join Date
    10-30-2019
    Location
    Bistrita, Romania
    MS-Off Ver
    2019; 365
    Posts
    231

    Re: Calculating data in pivots

    It should be possible after the pivot is made, then just refresh the pivot.

    Or, assuming the generated data always has the same number of columns and the same column order, have another column at the end of the generated data with a formula like:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    (I noticed there is a Table as Pivot Source).

    Of course, that column also has to be included in the pivot by default.
    And since you have a Table under the Pivot the column will be automatically included.

  5. #5
    Registered User
    Join Date
    09-10-2020
    Location
    Zeeland, Netherlands
    MS-Off Ver
    2013
    Posts
    13

    Re: Calculating data in pivots

    Quote Originally Posted by Mrrrr View Post
    It should be possible after the pivot is made, then just refresh the pivot.

    Or, assuming the generated data always has the same number of columns and the same column order, have another column at the end of the generated data with a formula like:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    (I noticed there is a Table as Pivot Source).
    The report does have the same amount of columns but will need to add one for the new format but does not have same amount of rows. How can i make it so that it automatically adds the formula to the a new column and changes the N/Y to 0/1 form.

    and then the original question remains how can i calculate the compliance from this data.

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,557

    Re: Calculating data in pivots

    Perhaps the following will be helpful.
    1. Add a new column (S) to the source data as modeled on Sheet1 using: =COUNTIFS([Overdue],"N",[Item Id],[@[Item Id]])/SUM(COUNTIFS([Overdue],"N",[Item Id],[@[Item Id]]),COUNTIFS([Overdue],"Y",[Item Id],[@[Item Id]]))
    2. Place the new Compliance column in the Values area of the field list and choose either Average, Max or Min for the summarizing the data.
    A small sample of the resulting pivot table is modeled on the PT sheet.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  7. #7
    Registered User
    Join Date
    09-10-2020
    Location
    Zeeland, Netherlands
    MS-Off Ver
    2013
    Posts
    13

    Re: Calculating data in pivots

    Thank you for replying.
    i think a did not make my intentions clear before.
    let me try to do it better. i have added a new file which has a Data sheet which is created from a database and i have no control over te input. (only format). from this data i would like to get an overview of the compliance of each item id.

    i thought i could do this by putting this in a pivot table as shown in sheet Pivotpercentage. however i do not know how i can calculate the compliance and show it in an overview like on this pivotsheet.
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,557

    Re: Calculating data in pivots

    This proposal employs Power Pivot.
    First the range on the Data sheet is converted to a table. (Ctrl + t)
    Note that you will likely have to change $A$1:$AZ$2030 to $A$2:$AZ$2030 before selecting OK.
    From the Power Pivot tab choose Add to Data Model
    Use the following calculated measure: Compliance:=CALCULATE(COUNTA(Table2[Overdue]),Table2[Overdue]="N")/COUNTA(Table2[Overdue])
    Format the measure as Percentage
    Use the Compliance measure in the Values field of the pivot table as modeled on the Power PivotPercentage sheet.
    Let us know if you have any questions.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    10-22-2020
    Location
    India
    MS-Off Ver
    2019
    Posts
    2

    Re: Calculating data in pivots

    Hello guys, I am new to pivot table. I use ms office 2019. Kindly help me with the attached excel. I will be deeply grateful and also would be able to save my job.

    regards
    Tapan
    Attached Files Attached Files

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,557

    Re: Calculating data in pivots

    Hello tmohantyofficial and Welcome to Excel Forum.
    Please do not break rule #4 by posting a request for help in a thread started by another member, as you have done twice, start your own new thread instead.
    Let us know if you have any questions.

+ 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. How to best present data without using pivots
    By Sebastien1 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-09-2015, 03:57 AM
  2. [SOLVED] Calculating pivots points for day trading when there is a no trade day
    By Araise in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-05-2014, 05:26 PM
  3. Replies: 0
    Last Post: 10-18-2013, 11:35 AM
  4. [SOLVED] Insert Slicer for Pivots Only or can we use it for Charts without Pivots?
    By eldwardo in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-02-2013, 04:27 AM
  5. how to split data in pivots
    By dksodhi in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 09-24-2013, 08:08 AM
  6. Help with getting data from two pivots into a table
    By gandyling in forum Excel General
    Replies: 6
    Last Post: 05-01-2012, 02:09 PM
  7. [SOLVED] I would like to build macro's to do pivots or part of pivots
    By Todd F. in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-29-2005, 11:05 AM

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