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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

New column with Grouped Rowcount

Hi,

 

I have data like this:

 

IDCategory
AC1
AC2
AC2
BC1
BC1
BC2

 

I want an extra column with the rowcount for Category C1 within each group. So that I get a result like this:

GroupCategoryCategory C1 Count
AC11
AC21
AC21
BC12
BC12
BC22

 

I only got this far: 

CountValues = CALCULATE (COUNTROWS(Table), Table[Category] ="C1"). But this simply puts a 1 when the row category is C1.. it should be pretty easy but I can't find my answer anywhere..
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Try a new Measure like


calculate(COUNTROWS(Table), filter(allselected(Table) , Table[Group] = max(Table[Group]) && Table[Category] ="C1"))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , Try a new Measure like


calculate(COUNTROWS(Table), filter(allselected(Table) , Table[Group] = max(Table[Group]) && Table[Category] ="C1"))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak Thank you for your reply! As a measure I see that it works, but I need is as a column, is there a posibility you think?

Anonymous
Not applicable

Ah, I just used the measurement to add as a colum and that works perfectly :)!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.