Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
vinicius_ramos
Helper III
Helper III

Date filter except last 6 days

I want to automatically create a date filter that always disregards the last 6 days.
For example, I have a database for the last 30 days and I want to get the data disregarding the last 6 days.
For example, today is the 30th, I have data from the 1st, if I disregard the last 6 days I would have to have data from the 1st to the 24th.
Can anyone help me, to do this filter in power query?

 

thanks!

4 REPLIES 4
watkinnc
Super User
Super User

= Table.SelectRows(PriorStepOrTableName, each [Date] < Date.AddDays(Date.From(DateTime.LocalNow()), -6))

 

--Nate


I’m usually answering from my phone, which means the results are visualized only in my mind. You’ll need to use my answer to know that it works—but it will work!!

Hi @watkinnc 

Didn't work. The expression error in "PriorStepOrTableName"

 

vinicius_ramos_0-1697556164207.png


Do you have any other suggestions?

 

Tks

Hi @vinicius_ramos

With "PriorStepOrTableName" @watkinnc is referring to the name of the prior step/table in your coding. Hope this helps!

Hello, @RobinHaerkens 

 

Sorry I dont understand, I need to create a new custom colunm?

 

tks.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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
Top Kudoed Authors