15 Replies Latest reply: Mar 2, 2018 5:38 AM by Pat Felicita

# Filtering and comparing two month year

What I want to do here is this, I have 3 years worth of data and what to compare costs in any given month.

How do I get create a calculated column that will be the difference of Cost Per Kg (in the right) - Cost Per Kg (in the left)

So in the example below, I would want have a column there that would be called Cost Per Kg (difference)

Row 1 will then be 15.66-15.74

Thanks.

• ###### Re: Filtering and comparing two month year

May be using Before function

CostPerKgExpression - Before(CostPerKgExpression)

Missing Manual - Before() and After()

• ###### Re: Filtering and comparing two month year

Thanks for the response. How do I do generate the calculated column in the pivot table?

• ###### Re: Filtering and comparing two month year

Not sure I understand your question?

• ###### Re: Filtering and comparing two month year

I was hoping to create a new column in the pivot like below. Thanks.

• ###### Re: Filtering and comparing two month year

Just add a new measure like this

CostPerKgExpression - Before(CostPerKgExpression)

Make sure to replace the CostPerKgExpression above with the expression you have for CostPerKg..

Does this make sense?

• ###### Re: Filtering and comparing two month year

Cost Per Kg is actually Cost/Weight.

When I added measure of Cost Per Kg Delta with Expression: ceil( Sum([Total Amount])/Sum([Actual Weight]),0.01)-Before(ceil( Sum([Total Amount])/Sum([Actual Weight]),0.01))

The other month would not show up, this is how it looked like

• ###### Re: Filtering and comparing two month year

You still have 2017-02 selected for your chart right?

• ###### Re: Filtering and comparing two month year

Yes. I still have it selected.

• ###### Re: Filtering and comparing two month year

Not sure... would you be able to share a sample?

• ###### Re: Filtering and comparing two month year

Here is the app, I have been working on.

• ###### Re: Filtering and comparing two month year

ceil( Sum([Total Amount])/Sum([Actual Weight]),0.01) - After(ceil( Sum([Total Amount])/Sum([Actual Weight]),0.01))

• ###### Re: Filtering and comparing two month year

sunnysahni, I have a followup question.

Is there a way to hide the last column?

• ###### Re: Filtering and comparing two month year

No straight forward way to do this, but there can be work around to do this

• ###### Re: Filtering and comparing two month year

Thanks Sunny!

• ###### Re: Filtering and comparing two month year

How do I do it?