In the attachment in the issue - Sheet1
I relied on the file I downloaded in your amazing webinar
I built a pivot report
And I need calculations based on the total amount
I added the calculations manually - but when I add the category to the rows of the report - it deletes the manual calculations.
How do I add calculations to the overall summary that will be part of the pivot report?
Unable to upload file Then I will attach a picture
Hi Lea,
If it's a regular PivotTable then the only way to add columns that are retained by the PivotTable is to add it as a Calculated Field or Calculated Item. If it's a Power Pivot/Data Model PivotTable then you need to write a DAX measure.
Mynda
I started working on DAX in Power Pivot My problem now is that I need the percentages only for the final total and not for all the lines (As in the attachment 11)
- how can this be defined ??
I need the result to be similar to the example attached here in the image (As in the attachment 33)
Thank You!!!!!!!!!!!!
Hi Lea,
PivotTables don't work like that. They don't leave cells blank, they're designed to aggregate the data based on the row and column labels. You might be better off using CUBE functions if you're using the data model, or GETPIVOTDATA.
Mynda
If I understand you correctly, you could achieve that look with a row set by only showing the field for the totals row.
The GetPivotData
Allows me a formula outside of the pivot and if I make changes to the pivot structure it disappears.
The CUBE function looks amazing but I prefer to be based on the pivot rather than create a re-report.
The question is how can you add a calculated field / item to the total amount
- which will be part of the report and its location will change even when the structure of the report changes ??
Below the line Total amount - a calculation result of amount * 0.17 will be obtained
"The GetPivotData allows me a formula outside of the pivot and if I make changes to the pivot structure it disappears." Build a separate PivotTable to support your requirements and link GETPIVOTDATA to that PivotTable so the values are always available.
Alternatively, take Velouria's suggestion and don't drill down to the lower row label level, so you only see the totals.
Mynda
Thanks for the response,
It is still not clear to me how to use with GetPivotData
Attached is a sample file
Where the years and months are in the columns
When you look at all the months - the formula works great
But when I only show the years - a REF error is obtained
And if I want to add another element to the lines of the report - everything goes wrong.
And there are 2 sections in the lines - if you only show the main section then the formula is not attached to the report
and there are many lines in the middle
what can we do??
Please refer only to this file - GetPivotData-Question-1.xlsx
I could not remove the other files
I would appreciate an answer on the attachment so I will better understand the solution.
Thank you very much for answering and being patient with all my questions !!
Leah
Hi Lea,
See file attached. Note: if you add fields to the rows area in the PivotTable with the calculated field you will get the 17% applied to every row. There is no way around this. This is how PivotTables are designed to work.
Mynda
This is an example of using a row set. I had to amend the MDX manually to make sure it will adjust if new products are added (which was not easy for me with a right-to-left setup!)
Velouria, your solution with the SET looks great
The thing is, I need more lines of calculations
I would like a brief instruction - how do I set up a set and enter the required calculations?
Thanks so much for the help and patience !! Leah
Add the fields you want calculated to the pivot table, then on the Pivot Table Tools, Analyze tab, use the 'Create set based on row items' option. That will allow you to remove any rows where you don't want the calculations shown (basically all the detail level).
Is there a guide on how to work with set based?
And how do you work with MDX? Where did you add the calculations ??
You add the calculations as measures in the data model, not using MDX. The MDX only determines what level of detail is shown in the set but you can do most of it manually in the UI by adding and deleting rows as needed.
I’ve never seen a guide to working with sets but I’m sure there must be one.