11 Replies Latest reply on Dec 28, 2018 8:50 AM by Yuri Fal

# Numeric Distribution calculation

Hello there!

I'm very beginner in Tableau and not so familiar with Calculated Fields.

I need to add ND column in the table: ND = sellers / Universe * 100% for all rows in the vis and for total as well.

Thank you!

• ###### 1. Re: Numeric Distribution calculation

Hi Artem,

Analysis Menu --> Create a calculated Field --> A Pop UP wil open

1) Provide the name as ND

2) Write the below calc

SUM(Sellers) /SUM(Universe)

3) Click Apply

4) Click ok

5) You will find the created calculation in Measures pane

6) Right Click on ND --> Default Properties --> Number format --> Select Percentage

7) Drag the ND after Universe in measure values Section

you will get the final O/P as Required

Hope this helps.

BR,

NB

• ###### 2. Re: Numeric Distribution calculation

Hi Naveen! Thank you for your attention

There is nuance I've forgot to tell: columns are not a measure but part of a pivot table.

Literally i need to calculate: ND = Value of the Fact named "sellers" / Value of the Fact named "Universe" *  100%

• ###### 3. Re: Numeric Distribution calculation

Hi Artem,

Could you please attach a sample workbook.

BR,

NB

• ###### 4. Re: Numeric Distribution calculation

Hi Naveen!

I've managed to calculate ND by this formula:

SUM(IIF([Fact]="Brand sellers",[Fact Values],NULL)) / SUM(IIF([Fact]="Universe",[Fact Values],NULL))

But I still can't add it to the table as a separate column: Sample is in attachment

• ###### 5. Re: Numeric Distribution calculation

You need to create separate calculation for each fact and use measure names and measure values to plot the data.

1 of 1 people found this helpful
• ###### 6. Re: Numeric Distribution calculation

I'm sorry Naveen, but I don't get your point. Can you please share an example?

• ###### 7. Re: Numeric Distribution calculation

Hi Naveen,

I've made all facts as calculated fields and calculate ND easily: In table format it looks ok, because I can filter necessary facts to show: But on a second sheet where facts displayed on a map one-by-one, I need to exclude at least 2 fields from the filter, but I don't know how: Can you please suggest the workaround?

• ###### 8. Re: Numeric Distribution calculation

So, I've hide unnecessary facts and workaround looks fine until I faced with the issue: I'm not able to use Measure Names dimension as a single filter for multiple sheets on a dashboard.

Seems it ruins the idea of using calculated facts

• ###### 9. Re: Numeric Distribution calculation

Hi Artem,

The perceived complexity of this (seemingly trivial) task

is derived from the fact that the data are not in a proper 'shape'.

Namely, the [Fact] (as well as the related [Brand] ) has to be a Dimension (as it is),

but it should include additional Values -- to be used as the 'placeholder' Headers

for the additional Marks on a view populated with the 'derived' (calculated) Measures.

And there is a simple 'rule' in Tableau:

to have Marks on a view one should have Rows in the data.

This brings us to the concept of a so-called 'Scaffold' datasource --

a specially prepared one which is logically structured as a 'virtual cube'

consisting of all the necessary Dimensions with all the necessary Values

(aka domain-complete). The combinations of these Dimensions Values

form the 'Cells' of the cube -- which translates to the Marks on a view --

so they could be populated with the results of (aggregated) Measures,

potentially from other datasources as well (via a Data Blending mechanism).

Please find the attached as an example of such a Scaffold datasource (and a view).

Hope it could help understanding. Please reply with any question that may appear.

Yours,

Yuri

BTW, you can drop me a message or email, and we talk about things.

• ###### 10. Re: Numeric Distribution calculation

Hi Yuriy!

I'm very appreciated for your reply and suggestions, but I already managed to build my report without reshaping the source data.

Can you please share some links where I can learn the best practices?

Thanks once again! Wish you merry holidays and happy New Year!

• ###### 11. Re: Numeric Distribution calculation

Hi Artem,

As for the references, i would recommend this: