cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TMQ Frequent Visitor
Frequent Visitor

Can I set page filters for "last 7 days"?

Hi, I have a report that has multiple pages, one for each customer.  On each page is 7 graphs, showing their activity for each of the last 7 days.

 

When I refresh the data, is there a very clever way to have the graphs update so they show the most recent data..... i.e. yesterday, the day before, the day before, etc..

 

 

At the moment I have to change the date on each graph on the page, and then on every page for each customer.

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Can I set page filters for "last 7 days"?

@TMQ - Generally, the technique to handle this is to create a custom column that is basically:

 

DaysOld = TODAY() - [Date]

Then, you just set your filter to DaysOld "less than x", in your case 7.

 

 


I have book! Learn Power BI from Packt


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

Proud to be a Datanaut!

8 REPLIES 8
austinsense Established Member
Established Member

Re: Can I set page filters for "last 7 days"?

Calculated Column on the Date Table

 

7DayFlag = IF(NOW() - Date[Date] <= 7 && Date[Date] <= NOW(), 1, 0)

 

 

Then you set the report filter on this field to 1 and it will update every time the report updates with the most recent 7 days.  You can replicate the same logic for different windows of time.

Austin is VP Operations at PowerPivotPro and a professional self-service enthusiast Smiley Happy
Highlighted
Super User
Super User

Re: Can I set page filters for "last 7 days"?

@TMQ - Generally, the technique to handle this is to create a custom column that is basically:

 

DaysOld = TODAY() - [Date]

Then, you just set your filter to DaysOld "less than x", in your case 7.

 

 


I have book! Learn Power BI from Packt


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

Proud to be a Datanaut!

austinsense Established Member
Established Member

Re: Can I set page filters for "last 7 days"?

@Greg_Deckler Oh gosh, that's much easier

Austin is VP Operations at PowerPivotPro and a professional self-service enthusiast Smiley Happy
Kpower Frequent Visitor
Frequent Visitor

Re: Can I set page filters for "last 7 days"?

Hi,

 

I din't get that.

So, I created two attributes one has the current date and the other has Current_Date-7 value.

 

So when I put this in visual filter it is asking me to select the dates from the calendar.

 

I'm missing what you said about you just set your filter to DaysOld .

jessewysong Member
Member

Re: Can I set page filters for "last 7 days"?

Hey good morning,

Quick question, I seem to be getting an error with what seems to be a very straight forward calculation:

 

mispelled.PNG 

 

I had been handling this previously by making a second query using a date filter but would love to figure out how to just do it with a calcualted column. 

 

Thank you!

 

 

 

 

jessewysong Member
Member

Re: Can I set page filters for "last 7 days"?

I was able to resolve this using what appears to be a new "Age" function built into Power BI. I duplicated by date column, converted it to Age via the date menu,. and then changed it to a whole number (it was calculating minutes initially I think). 

 

AndrewDang Member
Member

Re: Can I set page filters for "last 7 days"?

@Greg_Deckler

 

I want to have a slicer for Yesterday, Last Week and Last 30 Days. Below is my IF statement. However, the Last Week does not include Yesterday and Last 30 Days does not include Last Week. Can you help me fix this, please.

 

DatePeriod =
IF(INT(TODAY() - DimDate[Date]) =1, "Yesterday",
IF(INT(TODAY() - DimDate[Date]) < 7, "Last 7 Days",
IF(INT(TODAY() - DimDate[Date]) < 30, "Last 30 days", "Date Range")))

 

Thanks;

Andrew

 

eagletro Frequent Visitor
Frequent Visitor

Re: Can I set page filters for "last 7 days"?

Hi All,

 

I had a requirement to view tickets NOT updated (used column updateddate) in the last 7 days so i used power query for the below to create a custom column named UpdatedLast7Days.

 

if([Updateddate] < Date.AddDays(DateTime.Date(DateTime.LocalNow()),-7)) then true else false.

 

I then added a page level filter of the custom column i created called UpdatedLast7Daysand selected True only to show Tickets not updated in the last 7 days. Also the timeline visual is nice to add the updated date into the report, that way you can drill drown on the departments that are bad offenders. Smiley Happy

Helpful resources

Announcements
Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 378 members 3,249 guests
Please welcome our newest community members: