3 Replies Latest reply on Dec 23, 2016 1:53 AM by Stefan Hanotin

# Tableau calculated fields from 2 dimensions

I have a situation in Tableau where I need to do a calculation, but am stuck as to how best to approach it.

I have data in a table like this:

Organisation ID (Measure), Country (Dimension), FY16 Status (Dimension has 3 different values (Low,Medium,High)), FY17 Status (Dimension has 3 different values (Low,Medium,High)).

Sample of the Data:

• 12345, France, Low, Medium
• 12346, France, Medium, Medium
• 12347, France, High, Medium
• 12348, France, Low, High

What I need to do is create a table that shows the following columns:

• Country (rows)
• Count of Organisations per FY16 Low
• Count of Organisations per FY17 Low
• (Count of Orgs per FY17 Low - Count of Orgs per FY16 Low)/Count of Orgs per FY16 Low.
• Count of Organisations per FY16 Medium
• Count of Organisations per FY17 Medium
• (Count of Orgs per FY17 Medium - Count of Orgs per FY16 Medium)/Count of Orgs per FY16 Medium.
• Count of Organisations per FY16 High
• Count of Organisations per FY17 High
• (Count of Orgs per FY17 High - Count of Orgs per FY16 High)/Count of Orgs per FY16 High.

Any help would be greatly appreciated.

Please find the package workbook attached with a description of what exactly I am trying to achieve also in the Dashboard.

Thanks,

Stefan.

• ###### 1. Re: Tableau calculated fields from 2 dimensions

Stefan,

Could you possibly post a picture of the "end result" in excel or something? My fear is that this question won't be answered due to the wall of textual requirements. Use this to your advantage! So Your Question Didn't Get Answered...

1 of 1 people found this helpful
• ###### 2. Re: Tableau calculated fields from 2 dimensions

Hi all,

It's pretty simple.

Create `Low in FY16` as calculated field with formula

``IF [FY16 Status] = 'Low' THEN 1 ELSE 0 END ``

Create `Low/Medium/High in FY16/FY17Y` in the same way

Create `Low Change` as calculated field with formula

``(SUM([Low in FY17])-SUM([Low in FY16]))/SUM([Low in FY16]) ``

Create `Medium Change` and `High Change` as well

Now you got all the columns it's time to create a sheet.

Thanks,

Stefan.

• ###### 3. Re: Tableau calculated fields from 2 dimensions

Thanks Matthew.

I eventually got sorted, my apologies for taking so long to get back to this.

Cheers,

Stefan.