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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Count Number of Occurences of a certain text

Hello all,

 

I am new to Power BI. I wanted to make a pie chart with the number of occurrences of A, B, C, A&C, B&C etc in the last column of the following table.

 

ask1.PNG

 

For example, the number of times A is present in the last column is 34 and B is 68 and so on. I want to create a pie chart depicting this data. Can someone help me with this?

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

If B is within B&C should be counted?

If not, simply add a pie chart, use any unique column as counter and your B&C/B/A column as category...

View solution in original post

TomMartens
Super User
Super User

Hey,

 

I guess this is what you are looking for:

 

Just drag your last column to the legend property and also to the value property of the Pie chart, as the column has the data type text, Power BI automatically selects the aggregation function Count.

 

image.png

 

Hopefully this is what you are looking for.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

5 REPLIES 5
TomMartens
Super User
Super User

Hey,

 

I guess this is what you are looking for:

 

Just drag your last column to the legend property and also to the value property of the Pie chart, as the column has the data type text, Power BI automatically selects the aggregation function Count.

 

image.png

 

Hopefully this is what you are looking for.

 

Regards,

Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Anonymous
Not applicable

If B is within B&C should be counted?

If not, simply add a pie chart, use any unique column as counter and your B&C/B/A column as category...

Anonymous
Not applicable

I would be glad to know how to count B&C in B and C separately. 

Anonymous
Not applicable

Can you clarify?

Should B&C, B and C have THREE different slices in the pie?
Or in a case like
B&C ->3
B ->4 
C ->2

you expect to have TWO slices, one for B (4+3) and one for C (2+3)?

Anonymous
Not applicable

So, if the data is as following:
B&C occurs 4 times

B occurs 5 times

C occurs 6 times 

 

Then the count of B should be 9 and C should be 10. 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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