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
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
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.

Top Solution Authors