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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
ho86
Frequent Visitor

Get rowcount of same ID's as new column

I'm a M newbie, having difficulties to create a new column (Table.AddColumn) with PowerQuery comprising the number of (count) of same values in the respective table. Any ideas how to accomplish this?

 

In the following example, I want to create a column based on the rowcount of transaction ID's

 

Transaction IDValueRowcount (Unique Transaction ID)
1234Hello2
1234This is 2
4567A test1

 

 

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @ho86 ,

 

You want to use the Group By function.

Select your [Transaction ID] column, go to Home tab > Group By.

In the dialog, create one aggregate column that has the 'Count Rows' operation, and one with the 'All Rows' operation.

Once your table has been grouped, you can expand your 'All Rows' column back out again to get your original columns back.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

2 REPLIES 2
ho86
Frequent Visitor

Thanks Pete, so much easier than I thought!

BA_Pete
Super User
Super User

Hi @ho86 ,

 

You want to use the Group By function.

Select your [Transaction ID] column, go to Home tab > Group By.

In the dialog, create one aggregate column that has the 'Count Rows' operation, and one with the 'All Rows' operation.

Once your table has been grouped, you can expand your 'All Rows' column back out again to get your original columns back.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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 Kudoed Authors