cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RaduF
New Member

How do I calculate the number of occurrences from Column A, based on values 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

Hello! I have a table with the above 2 columns and I need to show each value from ColumnA in a Stacked bar chart, based on ColumnB:

A (first bar) - data stacked 2(Pass)+2(Fail)

B (2nd bar) - data stacked 1(Pass)+2(Fail)

C (3rd bar) - data stacked 1(Open)

And so on.

Thanks!

1 ACCEPTED SOLUTION
BobBI
Resolver III
Resolver III

Hi ,

 

Using your sample data , See the below soluton .

 

Drag Col A into x Axis

Drag Col B into into Value ( Select Count from context menu)

Drag col B again into Legend

 

You can also create a masure to calculate count and use measure instread of col B directly.

 

 

navigation.pnggraph.JPG

Hope it helps

 

Cheers!

Bob

View solution in original post

1 REPLY 1
BobBI
Resolver III
Resolver III

Hi ,

 

Using your sample data , See the below soluton .

 

Drag Col A into x Axis

Drag Col B into into Value ( Select Count from context menu)

Drag col B again into Legend

 

You can also create a masure to calculate count and use measure instread of col B directly.

 

 

navigation.pnggraph.JPG

Hope it helps

 

Cheers!

Bob

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power BI October Update 2021.jpg

Power BI Release

Click here to read more about the October 2021 Release!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Teds Dev Camp Oct. 2021 768x460.jpg

Power BI Dev Camp - October 28th, 2021

Mark your calendars and join us for our next Power BI Dev Camp!