Explore Courses Blog Tutorials Interview Questions
0 votes
in BI by (17.6k points)
How to plot the reference line to a chart that shows visual according to parameter selection? I want to show average sales across regions for total in a bar chart but avg of each category in the form of the reference line.

1 Answer

0 votes
by (47.2k points)
edited by

Hi Vaibhav,

Using a parameter, we can make the reference line dynamic.

These are the steps to make a dynamic reference line -

1. Create a bar chart with the region and average sales.

2. Add a parameter for the selection.

3. Then create a calculated field to match the parameter and calculate the aggregate that you want to use as a reference line.

Example, IF [Category] = [Cat Parameter] THEN [Sales]

                 ELSE 0


4. Add the created calculated field in Details shelf.

5. Now, We have to add an Average reference line on the chart. we have to click on the edit line and select the calculated field.

6. Click OK.

Hope it helps you.

Interested to learn about Tableau from top experts? Enroll in Tableau Course to get expert guidance.

Related questions

Browse Categories