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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
freelensia
Advocate II
Advocate II

Convert each value of column B into column headers, grouped by column A

I have a table Bounced Emails as follow:

 

Email         Bounce_Type
a@gmail.com hard
a@gmail.com soft
b@gmail.com hard
c@gmail.com soft

 As you can see, this table has no unique ID column! E-mails may repeat.

 

I want to sum over the first 2 columns like this.

Email         Hard count   Soft Count
a@gmail.com 1 1
b@gmail.com 1 0
c@gmail.com 0 1

 

I tried group by options but it did not yield good results.

 

Could somebody help me?

 

Thanks!

 

Freelensia

 

1 ACCEPTED SOLUTION
freelensia
Advocate II
Advocate II

I ended up doing this:

 

Let's say you have a table like this:
Site Type
  
You want something equivalent to dragging the Type variable from row to column in Excel's pivot table.
 
How to do it
1. Do a group by Site and Type
You will get a second table like this:
Site Type Count
 
2. Select the Type column, right-click, choose [Pivot Column].
In the next window, choose to Aggregate [Count] column created in previous step. expand [Advanced Options] and choose [Sum]
 
You will get the table you want:

View solution in original post

4 REPLIES 4
freelensia
Advocate II
Advocate II

I ended up doing this:

 

Let's say you have a table like this:
Site Type
  
You want something equivalent to dragging the Type variable from row to column in Excel's pivot table.
 
How to do it
1. Do a group by Site and Type
You will get a second table like this:
Site Type Count
 
2. Select the Type column, right-click, choose [Pivot Column].
In the next window, choose to Aggregate [Count] column created in previous step. expand [Advanced Options] and choose [Sum]
 
You will get the table you want:
Ashish_Mathur
Super User
Super User

Hi,

 

Create a matrix visual.  Drag Email to the row labels, Boune_type to the column labels and write this measure

 

=COUNTROWS(Data)

 

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

I think you could do that with 2 measures.   1 for each (hard, soft), the idea would then be to setup an IF statement to populate the field if it is hard or soft.

So a calculation you could do would be 

 

ishard = If(Table1[BounceType] = "hard", 1, null)

issoft = If(Table1[BounceType] = "soft", 1, null)

 last step would just be to count the values 

Thanks for the answer!

 

Sorry but I am completely new to PQ. Could you provide a bit more details on each step?

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