Overlapping bar charts in Tableau

237 Views Asked by At

I want to create overlapping bar chart in tableau like following: the bars with light shade show overall grade distribution for month of june and the darker shade bars show data for particular instructor id selected

What exactly I want to do is do a comparison for grade distribution for overall data versus the instructor id I select. I wrote lod for calculating the fixed overall value like this:{ FIXED [grade], [month] : COUNTD([record_id]) } and add this to the row shelf. Next I just add COUNTD([record_id]) to the row shelf to be able to check the grade distribution at instructor level.Whenever I select any instructor id in filter, calculation changes to the instructor level. But I want only one of the overlapping bars to show intructor level grade distribution whith the main fixed graph showing the overall grade distribution. I want to use month field as a filter for both the bar charts which is why I included in the LOD expression. How can I do this in tableau?

1

There are 1 best solutions below

0
MUFF. On

I believe this is an XY Problem, that being said:

Verify your data's LOD

Seems like there may be an error in your FIXED LOD Expression, although it is hard to tell as you did not provide a hierarchy of your data.

{FIXED [grade], [month] : COUNTD([record_id])} 

This calculation will fix your [record_id] to [grade] and [month]. Based off your explanation above every teacher seems to have an association with record_id for a month and a grade (I am assuming) and since your expression sits at finer level than the teacher level, it will split for teacher filters. Specifically this article on aggregation with FIXED LOD Expressions explains what is going on in view level compared to the expression level.

Once sorted, you can then...

Create a Dual Axis Bar Chart

  • Bring your bucketed columns to the column shelf.
  • Bring the two measure you wish to compare to the rows shelf.
  • Right click one of your measure pills and select dual axis.
  • In your Marks Pane make sure bar is selected; individually edit the size for each one of your continuous measures; note they are overlapping, make sure you size down the one in front.

See more on dual axis visualizations here.