How to add a new calculation in pivot table?
I want to add Sales Lift column by getting the difference of DuringPromo and PrePromo. See attached image.
How to add a new calculation in pivot table?
I want to add Sales Lift column by getting the difference of DuringPromo and PrePromo. See attached image.
Hi @jmdata ,
It it not possible in the pivot. But you can add a second pivot table, also with stores in the row showing your calculation.
Therfore we need two calculations that calculates the figures for the final calculation (the difference).
//PrePromo
ifelse({Promo Period}="prepromo",MEASURE ,NULL)
//DuringPromo
ifelse({Promo Period}="duringpromo",SALES,NULL)
Now you can calculate one minus the other one.
//Sales lift
sum({DuringPromo})-sum({PrePromo})
Note: please check for typos and replase SALES with your measure name.
The word after // are the names of the calculated fields.
Best regards,
Nico
This is the form of the table before the pivot table (see attached picture). Your suggested calculation wont work as each row in the table is only one period type, either prepromo, duringpromo, or postpromo.
Hi @jmdata ,
you are right, the calculation does not work as new column in the pivot table. As I already mentioned you have to add a second pivot table that shows the stores in the row and the new calculation. Then it works due to the issue, that the sales figures are aggregated per period type.
Best regards,
Nico
Hi @jmdata,
It’s been awhile since we last heard from you, did you have any additional questions regarding your post?
If we do not hear back within the next 3 business days, I’ll close out this topic.
Thank you!
Hi @jmdata,
Since we have not heard back, I’ll go ahead and close out this topic. However, if you have any additional questions, feel free to create a new post in the community.
Thank you!