Refreshing Data in a Pivot Table

Andy0311

Board Regular
Joined
Oct 16, 2019
Messages
118
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hello,
In the table below, I added a column April
1598889740785.png

I then go to my Pivot Table, click into the table, right click, select Refresh, and expect to get the new column incorporated properly into my table, but instead get this:
1598889958635.png

Another row April has been added. I thought it was the placement of my cursor, but I don't get the result I want with different cursor placements. I can't figure out what I am doing wrong. Any assistance would be greatly appreciated. Thank you. A
 

Attachments

  • 1598889293150.png
    1598889293150.png
    78.7 KB · Views: 19
  • 1598889583641.png
    1598889583641.png
    62.1 KB · Views: 17

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
first, this is not a Pivot Table but Query Table
second, post your M code using code tags: [CODE=pq] your code here [/CODE]

StaffClassJanFebMarAprStaffClassMonthLessons
BobMath40455060BobMathJan40
TomPE40455060BobMathFeb45
BrianSS40455060BobMathMar50
AimeeEnglish40455060BobMathApr60
TomPEJan40
TomPEFeb45
TomPEMar50
TomPEApr60
BrianSSJan40
BrianSSFeb45
BrianSSMar50
BrianSSApr60
AimeeEnglishJan40
AimeeEnglishFeb45
AimeeEnglishMar50
AimeeEnglishApr60
 
Last edited:
Upvote 0
I don't know what this (below) means, but thank you for responding.
"second, post your M code using code tags:
Power Query:
 your code here
"
 
Upvote 0
type [CODE=pq]
paste your code from Advanced Editor here
then type this [/CODE]
 
Upvote 0
Power Query:
= Table.RenameColumns(#"Unpivoted Only Selected Columns",{{"Attribute", "Month"}, {"Value", "Lessons"}})

I hope this is what you meant in your message. Thanks again.
 
Upvote 0
this is not whole code, I said open Advanced Editor , copy code (whole code) and paste here
but as I can see you used the wrong function
should be: UnpivotOtherColumns

Power Query:
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Unpivot = Table.UnpivotOtherColumns(Source, {"Staff", "Class"}, "Month", "Lessons")
in
    Unpivot
 
Upvote 0
Thanks for all your help. I started from the beginning and easily created my query table and updated it. I appreciate it. A
 
Upvote 0
You are welcome

it's nice to see if someone appreciate your work so you can hit (y)Like in the posts which have helped you

btw. Pivot Table from Query Table looks like

StaffClassMonthSum of Lessons
AimeeEnglishJan40
Feb45
Mar50
Apr60
BobMathJan40
Feb45
Mar50
Apr60
BrianSSJan40
Feb45
Mar50
Apr60
TomPEJan40
Feb45
Mar50
Apr60
 
Upvote 0
Thanks, Sandy! That will be one way I will use it to report the data. (y)
 
Upvote 0

Forum statistics

Threads
1,223,768
Messages
6,174,414
Members
452,562
Latest member
Himeshwari

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top