+ Reply to Thread
Results 1 to 15 of 15

Pivot table not showing the correct output (instead of the column names showing dates

  1. #1
    Forum Contributor
    Join Date
    12-02-2020
    Location
    Leeds
    MS-Off Ver
    Microsoft Office 365
    Posts
    279

    Pivot table not showing the correct output (instead of the column names showing dates

    Good afternoon,

    I have attached the sample file. The original file has more columns and data but the sample file represents the main problem I found in the original. Basically, We have healthcare professionals name as in column A in the sample file. Lets say they review a patient and if they start that patient on Inclisirian, we can see the date they were started in that column and the same goes for the columns C (for Statins). In the original data, either we have a date in those columns or they are blank.

    I want a report to show the following instead of the output shown in the attachment. It shows dates in the column header in the pivot table which I don't want. My desired output:

    Name Inclisiran Statins
    Jignesh 3 2
    Daxesh 1 1
    Viklo 1 1

    Can we breakdown further by months as well to see who has done what in each month?

    Thank you. Sorry, I can't attach the original.
    Attached Files Attached Files
    Last edited by Jigneshbharati; 09-28-2022 at 03:07 PM. Reason: Wrote pivot chart instead of pivot table

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Pivot table not showing the correct output (instead of the column names showing dates

    Hi,

    I would suggest first amending your source table within Power Query, selecting the Name column and then Unpivot Other Columns. Then Close & Load this table as Connection Only and check the Add to Data Model box. This will produce a layout which is more amenable to Pivot Table analysis.

    You can now construct a simple Pivot Table from this new table and add a Slicer for the dates.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Pivot table not showing the correct output (instead of the column names showing dates

    you can try change layout to this with Tabular Form or Compact Form

    btw. try to use shorter headers in your source table

    Name Inclisiran started Statin started Count of Inclisiran started Count of Statin started
    Daxesh (blank)
    24/05/2022
    1
    (blank)
    Jignesh
    23/05/2020
    1
    1
    30/06/2022
    1
    (blank) (blank)
    Viklo
    01/01/2019
    (blank)
    1
    (blank) (blank)
    Grand Total
    3
    2


    ptf.png
    Last edited by sandy666; 09-29-2022 at 01:39 AM.

  4. #4
    Forum Contributor
    Join Date
    12-02-2020
    Location
    Leeds
    MS-Off Ver
    Microsoft Office 365
    Posts
    279

    Re: Pivot table not showing the correct output (instead of the column names showing dates

    Hi Sandy666,

    Thanks. I don't want "blank" in my pivot. Instead of those individual dates, can we use months?
    Basically, we want to see:
    No of reviews by
    What was started or changed or stopped , no of them
    By month, in each month who has done what

    I really appreciate your help.

  5. #5
    Forum Contributor
    Join Date
    12-02-2020
    Location
    Leeds
    MS-Off Ver
    Microsoft Office 365
    Posts
    279

    Re: Pivot table not showing the correct output (instead of the column names showing dates

    Hi XOR LX,

    Thank you. I don't know about power queries. Could you please attach the solution so that I can follow how it works.
    Is it possible to use months in my pivot instead of those dates?
    Last edited by Jigneshbharati; 09-29-2022 at 02:02 AM. Reason: Giving more information

  6. #6
    Forum Guru HansDouwe's Avatar
    Join Date
    06-21-2022
    Location
    Nederland
    MS-Off Ver
    365 V2403 (Build 17330.20000)
    Posts
    6,466

    Re: Pivot table not showing the correct output (instead of the column names showing dates

    A solution with formula:

    Please try in B15:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    and try in C15 and copy down and across:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Attached Files Attached Files

  7. #7
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Pivot table not showing the correct output (instead of the column names showing dates

    like this?

    Count of Name Value
    Name Attribute January May June July August September Grand Total
    Daxesh Inclisiran started
    1
    1
    Statin started
    1
    1
    Jignesh Inclisiran started
    1
    1
    1
    3
    Statin started
    1
    1
    2
    Viklo Inclisiran started
    1
    1
    Statin started
    1
    1
    Grand Total
    1
    3
    1
    1
    2
    1
    9


    or

    Count of Name Attribute
    Name Month Inclisiran started Statin started Grand Total
    Daxesh May
    1
    1
    September
    1
    1
    Jignesh May
    1
    1
    2
    June
    1
    1
    July
    1
    1
    August
    1
    1
    Viklo January
    1
    1
    August
    1
    1
    Grand Total
    5
    4
    9
    Last edited by sandy666; 09-29-2022 at 02:36 AM.

  8. #8
    Forum Contributor
    Join Date
    12-02-2020
    Location
    Leeds
    MS-Off Ver
    Microsoft Office 365
    Posts
    279

    Re: Pivot table not showing the correct output (instead of the column names showing dates

    Thanks. This is good but is it possible to have it other way round?
    Swap months with drug started against those names.

  9. #9
    Forum Contributor
    Join Date
    12-02-2020
    Location
    Leeds
    MS-Off Ver
    Microsoft Office 365
    Posts
    279

    Re: Pivot table not showing the correct output (instead of the column names showing dates

    I like both but I prefer the second one. Thanks. You read my mind!

  10. #10
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Pivot table not showing the correct output (instead of the column names showing dates

    see attached file
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    12-02-2020
    Location
    Leeds
    MS-Off Ver
    Microsoft Office 365
    Posts
    279

    Re: Pivot table not showing the correct output (instead of the column names showing dates

    Thanks. Could you please explain how did you do the months column? How can we group those date values in the original table? and also explain the attribute column in your solution.

  12. #12
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Pivot table not showing the correct output (instead of the column names showing dates

    Data tab - Show Queries & Connections
    on the right side double click on Table1 then in Power Query Editor you'll see four steps (on the right side) and result table
    you can single click on each step to see how it works

    You can change Attribute to whatever you want

  13. #13
    Forum Contributor
    Join Date
    12-02-2020
    Location
    Leeds
    MS-Off Ver
    Microsoft Office 365
    Posts
    279

    Re: Pivot table not showing the correct output (instead of the column names showing dates

    Thank you so much for your help!

  14. #14
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Pivot table not showing the correct output (instead of the column names showing dates

    My pleasure

    more about Power Query: https://learn.microsoft.com/en-us/power-query/

  15. #15
    Forum Contributor
    Join Date
    12-02-2020
    Location
    Leeds
    MS-Off Ver
    Microsoft Office 365
    Posts
    279

    Re: Pivot table not showing the correct output (instead of the column names showing dates

    Thanks. I will look into this.

+ 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. Replies: 1
    Last Post: 02-17-2022, 12:15 AM
  2. Pivot table not showing correct values
    By kozz in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 03-13-2021, 10:08 AM
  3. Excel Pivot not showing correct results
    By HLL in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 02-04-2021, 06:24 PM
  4. Excel Pivot not showing correct information
    By Belinda001 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 12-05-2019, 10:33 AM
  5. [SOLVED] Gantt chart not showing correct start dates for all activities
    By chriswrcg in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 03-18-2019, 02:02 PM
  6. Pivot Chart showing project start and end dates
    By amlg in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 03-07-2018, 05:45 PM
  7. Amibroker chart not showing correct data from csv file
    By Shahadat65 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-18-2016, 06:43 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