1
votes

I would like to create a simple chart from 2 or more columns in Power BI.

Here's my data, for each column, a 1 marks an occurrence of an event, null means it did not happen.

enter image description here

I would like to turn this data into a very simple bar graph, showing both these fields' numeric totals (i.e. summing all the 1's). The bars would be shown side by side. I would like it to look exactly like this, only instead of male/female it would show "alcohol occurrences" and "MDMA" occurrences.

enter image description here

Here's my stacked column chart:

enter image description here

And when I try and put the column names on the axes so that they can be properly labeled, I get this:

enter image description here

I can achieve most of what I want using a clustered bar chart, but the problem there is that it won't let me label the axis with the alcohol / MDMA column names:

enter image description here

How can I make a simple, labeled graph, stacking both columns up against each other, showing the numeric sums for each column? Again, I want it to look exactly as the male/female example shown above. Is this even possible? Thank you in advance.

1

1 Answers

0
votes

In the above scenario, all the values are considered to be in the same category and that means there is no direct way to do this. There are a couple of workarounds to make it look like the desired output:

To get the gap between the two bars:

  1. You should create a new measure, Measure New = 0
  2. Add this measure in the middle of the two values in the bar chart
  3. This should give you a gap in between the two bars

To get the axis values added:

  1. Create two text boxes with the text "Alcohol" and "MDMA" added
  2. Place these text boxes below the respective bars to make it look like they are the axis values

These workarounds can become quite tedious when you have to do it for a larger number of charts/values. On a lighter note, it baffles me that you can consistently come up with these specific scenarios where you expect the charts to do exactly the opposite of what they are meant for 😉