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
Harri
New Member

Measrurement for count of rowrs based on text value

Hi,

 

This might be a simple question but I am q bit stuck with it.

 

Data is formatted like this (Table1):

Company; Sales-date
Acme Inc; 01.01.2022
Acme Inc; 02.01.2022
Acme Inc; 03.01.2022
Acme Inc; 04.01.2022
Customer Corp; 05.01.2022
Customer Corp; 06.01.2022
Customer Corp; 07.01.2022
SMB Ltd; 08.01.2022
SMB Ltd; 09.01.2022

 

Company column is a text field and I would like to summarize how many occurences there is for each value. For example, how many sales interactions was there in January for each company.

 

I would expect results like this for given data in report table: Company; number of sales activities:
Acme Inc; 4
Customer Corp; 3
SMB Ltd; 08.01.2022

 

I am adding a measurement like this:
Measure = COUNTROWS(filter(Table1, Table1[Company] = EARLIER(Company)))

 

This provides error:
EARLIER/EARLIEST refers to an earlier row context which doesn't exist.

 

I am doing something wront, but what?

 

Kind Regards,

Harri

1 ACCEPTED SOLUTION
ValtteriN
Super User
Super User

Hi,

COUNT should work for your example. E.g.

Measure 2 = COUNT('Table (8)'[Sales-date])

ValtteriN_0-1697959280985.png

In your measure you used EARLIER. EARLIER should be used in the context of calculated columns.

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

2 REPLIES 2
Harri
New Member

Thank you ValtteriN, this did the job! Much appriciated!

ValtteriN
Super User
Super User

Hi,

COUNT should work for your example. E.g.

Measure 2 = COUNT('Table (8)'[Sales-date])

ValtteriN_0-1697959280985.png

In your measure you used EARLIER. EARLIER should be used in the context of calculated columns.

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.