8 Replies Latest reply on Apr 2, 2019 12:45 PM by shivratan.gupta

# One Filter or Parameter to show multiple measures

Hey everyone -

I searched to see if there was already a discussion on this but cannot find one that has been answered

Is it possible to create one filter to display multiple measures which are all calculated fields.

Example: I have a parameter with two options Dollars and Units. When I select Dollars, I want the Total Dollars, Dollar %chg and Abs \$ chg measures to show on my table....when I select Units - I want the Total Units, Units % chg and U abs chg to show instead.

Can I create this on a calculated field? if so how?

I dont want to bring it into a Dashboard and use double filtering...:(

Cristina

• ###### 1. Re: One Filter or Parameter to show multiple measures

C Palo:

I know one way to display this and hope this helps. I have used Superstore data in the example below;

- Create a parameter with two values;

- Sums

- Counts

Create new calculated fields to show Sums or counts of a measure based on the parameter.

Show Profits

if [Selection] = "Sums" then

sum([Profit])

elseif [Selection] = "Counts" then

count([Profit])

end

Show Sales

if [Selection] = "Sums" then

sum([Sales])

elseif [Selection] = "Counts" then

count([Sales])

end

Use Show Sales and Show Profits as the measures to display. Thats it; based on what you select in the parameter, you will show those measures;

Sum Selection

Count Selection

Attached is the sample workbook.

..kk

1 of 1 people found this helpful
• ###### 2. Re: One Filter or Parameter to show multiple measures

Hi Palo,

Go through attached workbook, that is built to select Dimension, Measure, Aggregate function dynamically.

- Int he below screen shot, Dim: City, Measure: Profit, Aggregate Function: AVG

--- In the below screen shot, Dim: Region, Measure: Sales, Aggregate Function: Sum

Best Regards

Laxman Kumar

• ###### 3. Re: One Filter or Parameter to show multiple measures

Thank you both!

Both these packages thought something new to me which I am definitely going to use in future reports!

However it has not quite solved my problem yet. I am posting a sample workbook...explaining a bit better. Please take a quick look when you have a minute and let me know if there is a way to accomplish that!

Thanks again!

Cristna

• ###### 4. Re: One Filter or Parameter to show multiple measures

Thank you both!

Both these packages thought something new to me which I am definitely going to use in future reports!

However it has not quite solved my problem yet. I am posting a sample workbook...explaining a bit better. Please take a quick look when you have a minute and let me know if there is a way to accomplish that!

Thanks again!

• ###### 5. Re: One Filter or Parameter to show multiple measures

Cristna:

See Dynamic Report in the attached workbook and see that's what you are looking for.

If your output values have to be represented in different formats, there will be an issue. For example; we will be displaying either AVG(Discount) or SUM(Order Quantity) as your first value and the formats for both of them are different. AVG will be % and SUM will be a real number.

Currently, there is no FORMAT() function in Tableau and that will be an issue on how you want to show. Attached workbook is close to what we can get and hope it helps.

..kk

2 of 2 people found this helpful
• ###### 6. Re: One Filter or Parameter to show multiple measures

Thank you Karunaker!!!

This is actually will work - since the format will be somewhat the same based on the actual measures I have - Dollars and Units - I will just not have the \$ for currency - but that's ok!

% will be % for either dollar or unit!

Thanks!

Cristina

• ###### 7. Re: One Filter or Parameter to show multiple measures

Cristina:

Glad I could help. Was a little worried about the formatting , but looks like its OK. We definitely the format function, so we can display anyway possible.

..kk

• ###### 8. Re: One Filter or Parameter to show multiple measures

Hi Laxman ,

Can you please help to to have created to prompt to switch and display sheet, I have seen Tableau file 'Dynamic Dimension Measure & Aggregation Function - Advanced.twbx' have created 'Chart Type' parameter and a dimension 'sheet selection'. Can you please help to get linked with each sheet.