Create reference lines according to the values in the filter

420 views Asked by At

I need to visualize the number of teams that spent more than the salary cap allowed. So I want a reference line on behalf of the threshold of each year. However, it seems that the reference line doesn't change when I change the filter value. Here is how I want it to look: enter image description here Here is the data source: https://query.data.world/s/2lej7smnxcvc3gbv342j4chjslvrgo, I set "Season" as the filter so this is the visualization of only one season.

---EDIT---: I need a dashboard that shows the salaries in each season, so the salary cap threshold should be changed when I change the value in the filter "season".

2

There are 2 answers

4
AnilGoyal On BEST ANSWER

Further Edit

see this GIF

enter image description here

EDIT I added a reference line per pane with the following options-

enter image description here

  • check scope is per pane -check value is average - average

and see it works exactly as desired.

enter image description here

and

enter image description here

Now I am not sure what you have depicted on X-axis in your visual/dashboard??

OLD ANSWER Though I am not sure how you have added the reference line in the data but you may right click the season filter pill in filters shelf and add that to context

This will turn the filter action first of all calculations and may be your reference line acts like as desired.

3
Memphis Meng On

My final workaround is to combine two visualizations together and make the markers in the salary cap chart invisible:

  1. put the season into the filter cell, and only choose one option:

enter image description here

  1. put team in Columns and SUM(total salary) in Rows, and put another team into shape cell in the Marks card (make sure you assign the logo to the teams respectively): enter image description here

  2. put SUM(salary cap) in Rows, that makes you a second viz: enter image description here

  3. drag a reference line to your second viz, and here are the params that are supposed to be like: enter image description here

  4. so now can you made a line representing the cap, now what you are going to is make this line shown in your first chart, which means you should allow dual axis. Before, you also should convert the markers in the second viz into Polygon, that makes them invisible: enter image description here

  5. allow dual axis: enter image description here

One shortage of this solution is that the shape markers will become masked. So to make them recognizable, you better choose some images with transparent backgrounds.