cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
DanielGT-89
Level: Powered On

filter and count data by date of the day of a sharepoint column Function (Today) if possible

hello, How can I filter data from a sahrepoint list by date?

 

I need to count and show in several label, how many are pending and how many are ending based on a sharepoint column called (status)

 

show labels by date, if possible with the "today ()" function

 

It is similar to the template offered by powerapps called (Service Desk)

Captura.PNG

thanks

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: filter and count data by date of the day of a sharepoint column Function (Today) if possible

@DanielGT-89 

If you try to FILTER a date in SharePoint you will run into delegation issues.  You must create 3 new Number columns in SharePoint createdYear, createdMonth, createdDay.  For new every record that gets created you must populate these values. (e.g. 2/26/2019 becomes createdYear: 2019, createdMonth: 2, createdDay: 26).

 

Put this code in the OnVisible property

Set(
    currentDate,
    {
        Year:  Year(Today()),
        Month: Month(Today()),
        Day: Day(Today())
    }
)

 

Then you use this code to count the rows

CountRows(
    Filter(
        your_datasource_name,
        Status.Value = "Approved",
        createdYear = currentDate.Year,
        createdMonth = currentDate.Month,
        createdDay = currentDate.Day
    )
)

 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

5 REPLIES 5
Super User
Super User

Re: filter and count data by date of the day of a sharepoint column Function (Today) if possible

@DanielGT-89 

You can count the number of rows for each status by putting this into a label.  My response assumes Status is a Choices data type in SharePoint.

 

CountRows(Filter(your_datasource_name, Status.Value = "Approved", Created = Today()))

 

 ---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

DanielGT-89
Level: Powered On

Re: filter and count data by date of the day of a sharepoint column Function (Today) if possible

Hi thanks, at the time the date didn't work for me, 
All data is counted and not by the current day

 

Super User
Super User

Re: filter and count data by date of the day of a sharepoint column Function (Today) if possible

@DanielGT-89 

I don't understand your comment "all data is counted and not by the current day."

DanielGT-89
Level: Powered On

Re: filter and count data by date of the day of a sharepoint column Function (Today) if possible

hello, sorry, this is my app,

 


the gallery shows all the data entered, at the moment (4 records)

dashboard.PNG

 

I just want to show the data of the day, for example: the 2 records of day 26

 

I have a problem with this formula in the part   Created = Today()

CountRows(Filter(your_datasource_name, Status.Value = "Approved", Created = Today()))

it makes me wrong

 

 

 

Super User
Super User

Re: filter and count data by date of the day of a sharepoint column Function (Today) if possible

@DanielGT-89 

If you try to FILTER a date in SharePoint you will run into delegation issues.  You must create 3 new Number columns in SharePoint createdYear, createdMonth, createdDay.  For new every record that gets created you must populate these values. (e.g. 2/26/2019 becomes createdYear: 2019, createdMonth: 2, createdDay: 26).

 

Put this code in the OnVisible property

Set(
    currentDate,
    {
        Year:  Year(Today()),
        Month: Month(Today()),
        Day: Day(Today())
    }
)

 

Then you use this code to count the rows

CountRows(
    Filter(
        your_datasource_name,
        Status.Value = "Approved",
        createdYear = currentDate.Year,
        createdMonth = currentDate.Month,
        createdDay = currentDate.Day
    )
)

 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,292)