Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreJoin 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
I have a power query from SQL database to an Excel workbook. I need to filter the query rows using a start and end date from cells in the workbooks. I created the cells with values 5/1/2025 for start date and 5/31/2025 for end date. I then selected the start date cells and selected and created a query using Data==>Get Data from Table/Range. This created a Power Query named StartDate. I did the same for EndDate value resulting in query End date.
I am attempting to filter rows in my main query using these two query values. When I alter the main query filter rows code like this:
= Table.SelectRows(#"Filtered Rows3", each [SAMPLED_DATE] >= StartDate and [SAMPLED_DATE] <= EndDate)
I get this error:
Expression.Error: We cannot apply operator < to types Table and DateTime.
Details:
Operator=<
Left=[Table]
Right=5/8/2025 11:02:25 AM
I have checked and the data type for [SAMPLED_DATE], StartDate, and EndDate are all Date/Time. What am I missing?
Solved! Go to Solution.
It looks like your 'Start Date' and 'End Date' references are tables. You may want to look at using Table.FirstValue(). Something like the following might work for you.
Table.SelectRows(#"Filtered Rows3", each [SAMPLED_DATE] >= Table.FirstValue(StartDate) and [SAMPLED_DATE] <= Table.FirstValue(EndDate))
Proud to be a Super User! | |
It looks like your 'Start Date' and 'End Date' references are tables. You may want to look at using Table.FirstValue(). Something like the following might work for you.
Table.SelectRows(#"Filtered Rows3", each [SAMPLED_DATE] >= Table.FirstValue(StartDate) and [SAMPLED_DATE] <= Table.FirstValue(EndDate))
Proud to be a Super User! | |
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 5 | |
| 5 | |
| 4 |