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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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 Solution Authors
Top Kudoed Authors