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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Nigel_Mayhew1
Helper I
Helper I

Power Query: filter date column from 01/01/2018 until the end of the current month

Hi there,

 

I'm trying to filter a 'pure' date column in power query (formatted as date, without the time).

 

I need to filter the dates to only include entries from 01/01/2018 until the end of the current month (this part has to stay dynamic).

 

I tried various combinations, but can't get it to work.

 

Could someone please help?

 

Thanks,

Nigel

1 ACCEPTED SOLUTION
AMeyersen
Resolver III
Resolver III

The challenge is to properly convert between data types Date and DateTime:


= Table.SelectRows(#"previousStep", each [Date] >= #date(2018, 1, 1) and [Date] <= Date.EndOfMonth(DateTime.Date(DateTime.LocalNow())))

 

View solution in original post

3 REPLIES 3
AMeyersen
Resolver III
Resolver III

The challenge is to properly convert between data types Date and DateTime:


= Table.SelectRows(#"previousStep", each [Date] >= #date(2018, 1, 1) and [Date] <= Date.EndOfMonth(DateTime.Date(DateTime.LocalNow())))

 

Hi there,

 

Thanks very much. It worked perfectly.


What if the field is a DateTime?

 

Much appreciated.

It's pretty much the same. Just make sure to convert your filter criteria according to the columns data type.
Date to DateTime: DateTime.From(#date(2018, 1, 1))
DateTime to Date: DateTime.Date(DateTime.LocalNow())
https://learn.microsoft.com/en-us/powerquery-m/datetime-date

https://learn.microsoft.com/en-us/powerquery-m/datetime-from

 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.