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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

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

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

 

--Nate

Anonymous
Not applicable

Hi @Anonymous 

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

 

vinicius_ramos_0-1697556164207.png


Do you have any other suggestions?

 

Tks

Hi @Anonymous

With "PriorStepOrTableName" @Anonymous 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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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