ellie_in_wonderland
ellie_in_wonderland

Reputation: 1

Tableau calculation (Price Percentage Difference)

Percentage Price difference over a time period.

I was trying to manage this calculation by my own, but I still can not figure it out. I would appreciate any help here.

At the first view, you can see how each brand performs over a time period.

I would like to put here one more column "Percent Difference" which does the following "The [Price__List] with [Max Date] minus the [Price__List] with [Min date] divided by The [Price_List] with [Max Date]". Also the percentage difference within one time period.

The Max and Min Date for time period should be taken from the filter "Date lp".

Here are my calculations:

Price__List:

IFNULL((SUM([Price List])), PREVIOUS_VALUE(0))

Price Difference11:

(ZN([Price__List]) - LOOKUP(ZN([Price__List]), -1)) / 
ABS(LOOKUP((ZN([Price__List])), -1))

After an executing these two calculations, I get these views:

performing view:

image

percentage difference:

image

If I understand this right, Tableau calculates the percentage difference for each date. But I would like to see just one number per each brand.

Upvotes: 0

Views: 94

Answers (1)

MUFF.
MUFF.

Reputation: 791

Your calculation is fine, remove the [DateLP] pill from your columns shelf.

If you need a percent diff for all the dates as well, I would suggest duplicating this worksheet as is, removing [DateLP] from one of them, then combining them both in a dashboard.

Upvotes: 0

Related Questions