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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.