Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.