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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
Anonymous
Not applicable

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!!
Anonymous
Not applicable

Hi @watkinnc 

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

 

vinicius_ramos_0-1697556164207.png


Do you have any other suggestions?

 

Tks

Hi @Anonymous

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

Anonymous
Not applicable

Hello, @RobinHaerkens 

 

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

 

tks.

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

Check out the October 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors