cancel
Showing results for
Did you mean:
Anonymous
Not applicable

## How to count records within the current year?

I am trying to see how many records each person has entered for the current year from a sharepoint list. Here is what I have below:

"Current Year Count for " & User().FullName & ": " & CountRows( Filter(
Collection1,
Created >= Date(Year(Today()), Year(Today()), 1),
Created < Date(Year(Today()), 1 + Year(Today()), 1), IsMatch( 'Created By'.Email, User().Email)))

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team

## Re: How to count records within the current year?

Hi @Anonymous ,

You just need to use Year(Created), then it will return the created year.

Try this formula:

"Current Year Count for " & User().FullName & ": " & CountRows( Filter(Collection1,Year(Created)=Year(Today())))

Best regards,

Community Support Team _ Phoebe Liu

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
5 REPLIES 5
Level 8

## Re: How to count records within the current year?

Date(Year(Today()), Year(Today()), 1)

...into a label gives:

3/1/2187

...so maybe start there.

Community Support Team

## Re: How to count records within the current year?

Hi @Anonymous ,

You just need to use Year(Created), then it will return the created year.

Try this formula:

"Current Year Count for " & User().FullName & ": " & CountRows( Filter(Collection1,Year(Created)=Year(Today())))

Best regards,

Community Support Team _ Phoebe Liu

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

## Re: How to count records within the current year?

Wow, this method is so much more effective. Thank you!

Here's what I came up with!

CountRows( Filter(
Collection1,
Created >= Date(Year(Today()), 1, 1),
Created < Date(Year(Today()), 12, 31), IsMatch( 'Created By'.Email, User().Email)))

Anonymous
Not applicable

## Re: How to count records within the current year?

@v-yutliu-msft wrote:

Hi @Anonymous ,

You just need to use Year(Created), then it will return the created year.

Try this formula:

"Current Year Count for " & User().FullName & ": " & CountRows( Filter(Collection1,Year(Created)=Year(Today())))

Best regards,

Community Support Team _ Phoebe Liu

Will this also work on a table. I have grouped my data by the creator and then I want to count how many each user can submitted how many entries for the year. I have made a gallery to put these two columns in.

GroupBy(AddColumns(Collection1, "UserDisplayName", 'Created By'.DisplayName), "UserDisplayName", "GroupByUsersDisplayName")

CountRows( Filter(GroupByUsersDisplayName,Year(Created)=Year(Today())))

It seems like it is working, but I just want to make sure.

Level 8

## Re: How to count records within the current year?

Yes, this will work on a Table (i.e. Collection).  PowerApps essentially treats (for the most part) any complex data type that groups fields together into a Collection and any of the functions you see that do operations on data sources are treating those sources as Collections as well.

Announcements

#### Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

#### Power Platform World Tour

Find out where you can attend!

#### Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

#### Microsoft Learn

Learn how to build the business apps that you need.

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,678)