4 Replies Latest reply on Jan 17, 2019 10:05 AM by Dan Ribeiro

# Getting a continual density distribution in a dual axis when a filter is applied

Hello community,

I was wondering if you can answer what is probably an easy question which has stumbled me. Basically I have created a density distribution of Premier League player's xG Shots on goal. I created my own bins rather than using the automatic Tableau method but that's not the issue. I can graph this no problem for all players and see the results as per fig 1. My problem is that my end game is to then display this against any player's individual shot distribution on the same graph using a dual axis for comparative purposes. I created an L.O.D. calculation to display the avg regardless of any player filters applied, but my output only displays the avg. distribution where there is a corresponding value in the players 'bins', see fig 2. Note how the first point is now missing simply because the player had no shots in that particular range.

I'm probably missing something simple here,

My LOD calculation,in case it's necessary is: Avg Player Distribution =

sum({fixed [xG Bin 2]: count([xG Bin 2])})/

sum({fixed: COUNTD([Player])})

Many thanks.

• ###### 1. Re: Getting a continual density distribution in a dual axis when a filter is applied

Add Filter to CONTEXT and if that doesn't work, Pl attach some workbook with fake data

• ###### 2. Re: Getting a continual density distribution in a dual axis when a filter is applied

Thanks Deepak, but unfortunately it didn't do the job. The LOD Avg Distribution (the line graph) changes when this is applied to match that of the player in question. Also it removes empty bins completely from the axis which is not what I want to do.

I have Tableau Public, so I can't save and attach a wkbk.... if I was to save something on Tableau public would this help?

• ###### 3. Re: Getting a continual density distribution in a dual axis when a filter is applied

Yes you can Save there

• ###### 4. Re: Getting a continual density distribution in a dual axis when a filter is applied

Thanks for your help on this.