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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
annaamalaim
Frequent Visitor

Table level filter for dates

Hi All,

 

I have to filter my the report within the current date and it should not exceed the current date and display the date.I have found the below query as a solution

 

= Table.SelectRows(#"Renamed Columns1", each [Appointment Date By] <= Date.From(DateTime.LocalNow()))

 

but the query throws a error "We cannot apply operator < to types Date and DateTime.
Details:"

 

I am new to power BI , can anyone please let me know whether a solution is possible?

 

Kind Regards,

Anna

1 ACCEPTED SOLUTION

Hi 

 

I got a solution by using the below code

 

= Table.SelectRows(#"Changed Type", each [Appointment Date By] <= #datetime(Date.Year(DateTime.LocalNow()), Date.Month(DateTime.LocalNow()) ,Date.Day(DateTime.LocalNow()), 23, 59, 0))

 

Now the date has been filtered !!

 

- Anna

View solution in original post

3 REPLIES 3
vanessafvg
Community Champion
Community Champion

@annaamalaim

 

= Table.SelectRows(#"Expanded NewColumn", each [Repair Completion Date] <= Date.From(DateTime.LocalNow()))

 

i ran this and had no issues on it - my repair completion is a DateTime

 

 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Hi 

 

I got a solution by using the below code

 

= Table.SelectRows(#"Changed Type", each [Appointment Date By] <= #datetime(Date.Year(DateTime.LocalNow()), Date.Month(DateTime.LocalNow()) ,Date.Day(DateTime.LocalNow()), 23, 59, 0))

 

Now the date has been filtered !!

 

- Anna

Hi 

 

I got a solution by using the below code

 

= Table.SelectRows(#"Changed Type", each [Appointment Date By] <= #datetime(Date.Year(DateTime.LocalNow()), Date.Month(DateTime.LocalNow()) ,Date.Day(DateTime.LocalNow()), 23, 59, 0))

 

Now the date has been filtered !!

 

- Anna

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.