7 Replies Latest reply on Aug 18, 2016 9:08 PM by H K

# why doesn't my division work properly?

I'm trying to do something very simple here. Divide Commission by Profit/Loss to give me a percentage.

Looking at the screen shot... for the first row... 24 / 150 should be 0.16.

Where on earth is Tableau getting its data for the percentage column?

• ###### 1. Re: why doesn't my division work properly?

Alternatively, assuming you have the layout you want, do SUM([Commission])/SUM([Profit/Loss])

• ###### 2. Re: why doesn't my division work properly?

Can you attach a workbook with sample data ? In a .twb format

The calculated field of percentage seem to work fine for me.

• ###### 3. Re: why doesn't my division work properly?

SUM([Commission])/SUM([Profit/Loss]) Doesn't work.

• ###### 4. Re: why doesn't my division work properly?

Hey H K,

Why doesn't that work? Do you get an error? It's working in the sample workbook for me...

• ###### 5. Re: why doesn't my division work properly?

neither method works. Your original suggestion on the percentage measure breaks.

And then if I make a new calculation it doesn't work either.

• ###### 6. Re: why doesn't my division work properly?

I deleted both measures and started over.

SUM([Commission])/SUM([Profit/Loss])  works provided the formatting is set as percentage after the fact.

Thanks!

• ###### 7. Re: why doesn't my division work properly?

Yep! You are almost there in both screenshots!

In screenshot #1, you are aggregating a field that is already aggregated. Simply drag "percentage" to the "SUM(percentage)" area to stop aggregating it.

In screenshot #2, you simply need to change the formatting on your field to percent. Right click->format.

Let me know if you have any questions on it!