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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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"))

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"))

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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