5 Replies Latest reply on Nov 11, 2018 3:56 PM by Shinichiro Murakami

# How could I calculate a Percentage difference between two Dimensions?

Issue Description:

I've a problem by using a dimension that I've already created using the FIXED property.

To I would classify a records of different sites on "FIXED" and "EVENTUAL" I use the next calculated field.

IF {FIXED [Id Sitio]:SUM(IF [Sub Cost] = "Electricidad" THEN 1 ELSE 0 END)} >= 1 AND {FIXED [Id Sitio]:SUM(IF [Sub Cost] = "Diesel" THEN 1 ELSE 0 END)}>=4 THEN "FIXED" ELSE "EVENTUAL" END

Last formule meets with a classification exactly that I wanted. So I got the next with te new Dimension:

But, I need to add a row with a percentage difference between the "Eventual" Column value and the "Fixed" Column Value, So I tried with a formula by using LookUp Property as I've shown below.

LOOKUP(SUM([Cost]),0)/LOOKUP(SUM([Cost]),LAST())

It didn't works actually due to It shows me up two results. One of them is exactly that I wanted (56%) but the other one is completely wrong. I just want a difference between "Eventual" row and "FIXED" Row

I really hope someone could give me a hand with this. Thanks for reading.

By the way I didn't attach the input and tableau file as package because is bigger than the forum limits.

• ###### 1. Re: How could I calculate a Percentage difference between two Dimensions?

Hi Alan,

We can't open .twb. Please attach a .twbx.

Thanks

Deepak

• ###### 2. Re: How could I calculate a Percentage difference between two Dimensions?

Hi Alan,

Since you have a single measure the easiest way to calculate the percent difference is to apply a quick table calculation.

Is this what you are after?

Cheers,

Sasha

• ###### 3. Re: How could I calculate a Percentage difference between two Dimensions?

HI Alan here you go.

Shin

• ###### 4. Re: How could I calculate a Percentage difference between two Dimensions?

Thanks alot for everything, this was so useful for me

• ###### 5. Re: How could I calculate a Percentage difference between two Dimensions?

Hi Alan,

You are welcome

and could you mark my answer as correct to close the thread, not from inbox but from original post.

Thanks,

Shin