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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount 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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors