Blueleaf
Blueleaf

Reputation: 49

How do I calculate the number of occurrences from Column A, based on value of column B in Power BI

ColumnA  ColumnB
A        Pass
A        Fail
A        Pass
B        Fail
A        Fail
C        Open
D        Fail
B        Fail
B        Pass
D        Open
E        Pass

I need to show each of Column A as a column with the count of values from Column B, in a stacked bar chart:

First bar: 2(Pass)+2(Fail)

Second bar: 1(Pass)+2(Fail)

... and so on.

Upvotes: 1

Views: 143

Answers (1)

StelioK
StelioK

Reputation: 1781

If you just create a simple measure like this:

Measure = CALCULATE(COUNT('Table'[ColumnB]))

Then select a stacked bar chart from the visualizations pane, and configure like this:

enter image description here

You should get this:

enter image description here

Which I think, is what you are looking for.

Hope that helps!!

Upvotes: 2

Related Questions