Reputation: 1933
My scenario is like that:
What I need is a bar chart that shows how many questions with "yes" I have for each question. The final chart should have two colunms, one labeled "Q01" and other "Q02" (those are the names of the columns), each column counting the "yes" for the corresponding question.
That should be simple with filters and a clustered bar chart. Set the two columns (Q01 and Q02) to Y axis and one filter to each column to select only "yes". However, when I set the two columns together Power BI displais both columns with the same size, with what looks like the intersection of the both columns.
How to fix it?
Sample data
This is a simple example:
Generated from Sample = {(1, "yes", "yes"),(2, "no", "yes"),(3, "no", "yes"),(4, "yes", "no"),(5, "yes", "yes")}
The result is
Upvotes: 2
Views: 1028
Reputation: 30219
Import your data into power query.
Select id columns and then unpivot other columns from the ribbon.
Close and apply.
Add a measure:
Measure = CALCULATE(COUNTROWS('Table'), 'Table'[Value] = "yes")
Add a stacked bar and add the following to the field well.
Upvotes: 1