cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
SylvieLet17
Level 8

Filter Chart Data by Week

Hi all, 

 

I have an app with a graph connected to a SharePoint list. 

every day an item is submitted for the day. Fields are:

Date

Patients

Deaths

I have 2 calculated columns which show that entry's Week start and week end.

WeekStart =Date-(WEEKDAY(Date,2)-1)

WeekEnd =Date+(7-WEEKDAY(Date,2))

I have a view in to display the current week's data: WeekStart>=[Today]-7 AND WeekEnd<=[Today]+7.

Basically I want to filter my graph based on the same criteria. I would like it to display the current week of data.

Something like Filter(MyData,(WeekStart>=[Today]-7),(WeekEnd<=[Today]+7))

But I think I am way off on the syntax here.

Help?

1 ACCEPTED SOLUTION

Accepted Solutions
PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Filter Chart Data by Week

You can use the Weekday and DateAdd functions to implement the same logic that you have in the SPO calculated columns:

Filter(
    MyData,
    Date > DateAdd(Today(), -Weekday(Today()), Days),
    Date <= DateAdd(Today(), 7-Weekday(Today()), Days))
2 REPLIES 2
PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Filter Chart Data by Week

You can use the Weekday and DateAdd functions to implement the same logic that you have in the SPO calculated columns:

Filter(
    MyData,
    Date > DateAdd(Today(), -Weekday(Today()), Days),
    Date <= DateAdd(Today(), 7-Weekday(Today()), Days))
SylvieLet17
Level 8

Re: Filter Chart Data by Week

You're a star! Thank you so much!