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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.