cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
kumar_a_136 Regular Visitor
Regular Visitor

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

Accepted Solutions
adetogni Established Member
Established Member

Re: Count Number of Occurences of a certain text

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...

Super User
Super User

Re: Count Number of Occurences of a certain text

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

Hamburg - Germany
If I answer you question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!
5 REPLIES 5
adetogni Established Member
Established Member

Re: Count Number of Occurences of a certain text

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...

Super User
Super User

Re: Count Number of Occurences of a certain text

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

Hamburg - Germany
If I answer you question, please mark my post as solution, this will also help others.
Proud to be a Datanaut!
kumar_a_136 Regular Visitor
Regular Visitor

Re: Count Number of Occurences of a certain text

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

adetogni Established Member
Established Member

Re: Count Number of Occurences of a certain text

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)?

kumar_a_136 Regular Visitor
Regular Visitor

Re: Count Number of Occurences of a certain text

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
Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Summit Australia 2019

Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

Top Ideas
Users Online
Currently online: 109 members 1,603 guests
Please welcome our newest community members: