Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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 ID | Value | Rowcount (Unique Transaction ID) |
| 1234 | Hello | 2 |
| 1234 | This is | 2 |
| 4567 | A test | 1 |
Solved! Go to Solution.
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
Proud to be a Datanaut!
Thanks Pete, so much easier than I thought!
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
Proud to be a Datanaut!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.