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

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

Reply
Nosh10
Helper II
Helper II

Count and Group Multiple Columns

Hello, 

 

I have not been able to find an answer to this question and hope someone can help me out. Thank you. 

 

 I have the following data. 

Gender Group 1Gender Group 2Gender Group 3
FFM
FFM
MFF
MFF
MMF

 

I would like to create a pie chart that shows two categories "M" and "F" across three columns and the total number of males and females for each category. For example Pie chart shows M = 6 and F = 9. Is this possible in PBI? Thank you. 

 

Thank you. 

 

1 ACCEPTED SOLUTION
BI_Jo
Resolver III
Resolver III

Hi,

 

To achieve this you can unpivot the table in Power Query Editor:

 

1. Highlight the 3 columns and use the 'unpivot columns' button in the 'transform' menu:

2. Add a new column called something like 'count' and add the value 1 to each row

 

3. Set the new column format to 'whole number'

4. You can now create a pie chart like this, setting the 'count' column as the value and the male/female column as the legend:

BI_Jo_0-1604622275021.png

Hope this helps.

 

Jo

View solution in original post

3 REPLIES 3
camargos88
Community Champion
Community Champion

@Nosh10 ,

 

Check the attached file.

 

I've unpivoted the table, like:

Capture.PNG

 



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



BI_Jo
Resolver III
Resolver III

Hi,

 

To achieve this you can unpivot the table in Power Query Editor:

 

1. Highlight the 3 columns and use the 'unpivot columns' button in the 'transform' menu:

2. Add a new column called something like 'count' and add the value 1 to each row

 

3. Set the new column format to 'whole number'

4. You can now create a pie chart like this, setting the 'count' column as the value and the male/female column as the legend:

BI_Jo_0-1604622275021.png

Hope this helps.

 

Jo

It worked. Thank you so much!

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors