5 Replies Latest reply on Jan 20, 2019 10:11 PM by Mahfooj Khan

# How to use one filter to for two dimensions and summarise two fields?

Hi community,

Is there a way to apply one filter (parameter) for two dimensions and based on a value chosen in parameter calculate 2 measures independently as shown on image below? So, If we choose "31" everything in grey will be calculated as sum("Mea1") and everything in blue as sum("Mea2").

Thank you.

• ###### 1. Re: How to use a filter (parameter) for two dimensions and summarise two fields?

It is very difficult to understand your logic.

Could you create sufficient number of sample data in excel with expected answer examples.

Thanks,

Shin

• ###### 2. Re: How to use one filter to for two dimensions and summarise two fields?

Hi Shinichiro,

I've attached an Excel Sheet with sample data. Basically, the expected result is: There is a filter in the workbook, this filter is applied for two dimensions simultaneously. Hence, if you choose in this filter "31" measure 1 and measure 2  will be calculated independently.

Thank you.

• ###### 3. Re: How to use one filter to for two dimensions and summarise two fields?

With Using parameter, it's simple and straight forward

Filter's case, you need duplicate data and solution get much more complicated.

Thanks,

Shin

• ###### 4. Re: How to use one filter to for two dimensions and summarise two fields?

Hi,

There are different ways to get this done even though there is no direct solution for this. Please find the attached workbook. This solution will work fine but bit tedious to maintain when the dataset becomes large. Hope it helps.

Please mark the answer as helpful if it resolves the issue.

Thanks,

Vishnu

• ###### 5. Re: How to use one filter to for two dimensions and summarise two fields?

Hi,

If you can prepare your data like this then it will be very easy for your to get the output without any calculation.

Find my approach below, normalize your data set into two sets like this then union both the data sets. Follow the screenshot

Connect the final data in tableau then drag the fields in canvas and check.

Workbook and excel attached for your reference. Let us know if this help.

Mahfooj