5 Replies Latest reply on Jun 13, 2016 10:47 PM by Ivan Young

# percentages changes on graphs

Tableau's Order of Operations

I am trying to create the graph for Fixed LOD.

When i deselect chairs and Charimats, the graph on the right side %es should not change.

Where is the error ? Please suggest

• ###### 1. Re: percentages changes on graphs

Hi msa,

I can't open your workbook but I've experienced this behavior before.  I'm not exactly sure why it occurs(I suspect it's when creating the % of total calc needing to = 100%) but I can suggest a workaround.  Create a % of total using only LOD and the %'s of the right pane will stay the same when you deslect an item, see screenshots below.  Please let me know if you have any questions.

Regards,

Ivan

LOD % of total for subcategory:  { FIXED [Sub-Category] : SUM([Sales]) }/{FIXED : SUM([Sales]) }

• ###### 2. Re: percentages changes on graphs

hi Ivan

here is the attachment

when i deselect chairs and charimats it changes the percentages in all bars ,it should not be like that, they should remain constant.

Please correct if what i expect is wrong .

i see % same in all cases ,if i deselect chairs and charimats , i see tables as 31.46% in all cases .Is this right ?  then what is the use of Fixed LOD here ?

Please suggest if a misunderstood this part here ?

see this screen shot as per

• ###### 3. Re: percentages changes on graphs

Thanks for the attachment MSA, I attached is a  workbook where the % of totals on the right side do not change.  When  you filter out a product-subcategory that row will disappear, however it's counts will still be used in the denominator when calculating the % of total.  Let me know if you have any questions or if you are trying to do something different.

• ###### 4. Re: percentages changes on graphs

Hi @Ivan

or

Little confused , could you please explain what is the use of fixed lod here ?

But in other cases you may want the percentages to hold steady even as you filter items in or out. That’s what we want in this case.

In which cases?

• ###### 5. Re: percentages changes on graphs

Hi MSA,

I'm not really an expert on the way Tableau works but I'll explain to the best of my understanding.  When you derive a % of total, SUM([Sales]) / TOTAL(SUM([Sales])), using a table calculation the total will always = 100% even when the data is filtered as the filter is being applied to both the numerator and denominator.   When using an LOD to derive a % of total that % is derived on the row level and will not change when data is filtered out of the view, and the % will hold steady.

I also noticed you seem to be applying some table calculation to the LOD you created, this is why your % of total changed when you applied filters.  If you just leave it as a SUM the % should not change when filtered..

Below are a few screenshots demonstrating what is happening and the difference

% of Total using a table calculation with the numerator and denominator and no filters.  These would be the same values using an LOD to calculate % of total.

% of Total using a table calculation with the numerator and denominator with Chairs & Chairmats excluded.  Notice how the denominator decreased by the sum of the Chairs & Chairmats row.

% of total using LOD with numerator and denominator with no filters applied.

% of total using LOD with numerator and denominator with Chairs and Chairmats excluded.  Notice how the denominator doesn't change even though Chairs & Chairmats are excluded.

Let me know if you have any questions.

Regards,
Ivan