4 Replies Latest reply on Nov 8, 2018 8:05 AM by Kristina Slavuljica

# Dinamic Waterfall Chart - difference vs. previous period

Hi all,

I am new to the community and also very new to Tableau...

I need help with something that is probably very easy, but I am not capable to solve myself.

Attached is an example of data I need to display by using a waterfall chart: simply, I need to show the difference vs. (running) previous month, but this has to be dinamic depending on the selected month. And then, displayed as per 'Waterfall Example' sheet.

It doesn't look like I can do it by using the Table Calculations and I don't know how to use the "Selected month" in a calculated field... in excel is a very basic concept, but I am getting lost here

Many thanks in advance for any help

Kris

• ###### 1. Re: Dinamic Waterfall Chart - difference vs. previous period

Kris,

Welcome to the Forum.

I'm not sure if this is quite right, but please see if this can give ideas.

As you said, it is all about the table calculations.

The difference for a brand from one month to the next is:

ZN(SUM([Exc.Cost \$ (M.USD)])) - LOOKUP(ZN(SUM([Exc.Cost \$ (M.USD)])), -1)

( I simply dragged the quick calculation pill to the Measures pane).

To do so, I moved the Date(Months) to the Detail shelf.

Running Total became:

RUNNING_SUM([Diff ExcCost])

Then the critical part is the settings for the table calculation

(not sure if I got them quite right)  as shown below.

Dinamic Waterfall Chart - difference vs. previous period

• ###### 2. Re: Dinamic Waterfall Chart - difference vs. previous period

Many thanks Swaroop Gantela,

This solution would be perfect except for the fact I cannot then sort by your new calculation fields. For some reasong it works in the test enviroment, but when I tried to replicate this into my actual data, the sort is disabled for all calculated fields that I have replicated from your file.

Again, many thanks and please let me know

Thanks

• ###### 3. Re: Dinamic Waterfall Chart - difference vs. previous period

Kristina,

Could you describe more the dimension that you are seeking to sort,

I think it is represented as Brand ID in the test set? That is, is it

a calculated field or is it coming straight from the datasource?

If a calculated field, could you post its equation?

There are other methods of sorting other than using the right-click sort pop up.

Not sure if it will work for your setup, but it would be putting a discrete copy of

the sort-by-measure to the left of the dimension in question:

Would be grateful, if permissible, if you could post a screenshot of your worksheet,

including the pill locations on all the shelves. You could blur out anything you don't want visible.

• ###### 4. Re: Dinamic Waterfall Chart - difference vs. previous period

Thank you so much for helping me with this....

I don't think this is going to help me actually.... I have re-posted another question, where I attached an excel as the actual example - Called "Waterfall Chart"

It didn't let me attach an excel to this, that is why I had to start over

Let me know if you can help me with this

Thanks again