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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
AOD
Helper III
Helper III

Filter 1 year data based on current date while extraction

Hi All, 

I need to extract last 1 year of data from source based on current date . 

Thanks in advance for solution. 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@AOD , add a filter like this in power query

= Table.SelectRows(#"Changed Type", each [Sales Date] <= DateTime.Date(DateTime.LocalNow()) and [Sales Date] >= Date.StartOfMonth(Date.AddMonths( DateTime.Date(DateTime.LocalNow()),-12)) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @AOD ,

When you use Power BI (at least these days), the default option after selecting your tables is Load. If you just load data directly, then the entire data rows in that table (it might be 20 years of data or 50 million rows), will be loaded into the memory. 

Please try to use TransForm data.

Then filter the data in Power Query according to date.

More details:Only Get the Last Few Periods of Data into Power BI using Power Query Filtering 

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@AOD , add a filter like this in power query

= Table.SelectRows(#"Changed Type", each [Sales Date] <= DateTime.Date(DateTime.LocalNow()) and [Sales Date] >= Date.StartOfMonth(Date.AddMonths( DateTime.Date(DateTime.LocalNow()),-12)) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Solution Authors