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
glauberdmo
Frequent Visitor

make a column that counts number of values equal the value of the same row

I saw another post that counts a especific value: 

 

ColumnName1 = CALCULATE ( COUNTROWS (Table 1), Table 1[fieldName] = "Value")

 

I don't want to choose a constant value, I'd like to build a column that counts using a value from a column. Example:

 

Colors    Count

Blue         3

Blue         3

Blue         3

Yellow     2

Yello       2

 

How to parse the Color column? 

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

@glauberdmo

 

Hi. Use a new calculated column with this Code:

 

Column =
COUNTROWS ( FILTER ( Table1, Table1[Color] = EARLIER ( Table1[Color] ) ) )

 

New Column.png




Lima - Peru

View solution in original post

2 REPLIES 2
Vvelarde
Community Champion
Community Champion

@glauberdmo

 

Hi. Use a new calculated column with this Code:

 

Column =
COUNTROWS ( FILTER ( Table1, Table1[Color] = EARLIER ( Table1[Color] ) ) )

 

New Column.png




Lima - Peru

That "EARLIER" function is what I need! Thank you! Marked as answered.

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.