Forum Discussion
Direct Query with Where clause for date time field
- 6 years ago
Such as:
"SELECT COL1, COL2 FROM Table WHERE Date_Column > " & Start_date
2. Usually not. As long as you don't get a warning about an operation not supporting direct query you are fine. Power Bi will append a where clause to the end of your query when filtering happens.
E.g. if your query is:
SELECT A FROM B.
Then when a user of the report click a filter, Power Bi will do something like:
SELECT * FROM ( SELECT A FROM B) WHERE B == 'ABC'
Sorry. Are you saying the condition should be changed to & Start_date &. Tried it and that gives an error.
Message=Incorrect syntax near '&'.
On the second suggestion, doesn't the model still try to query the whole table? I do have multiple joins on subsequent steps after filtering this table .I am new to the Power BI and trying to understand this from a performance point of view if applying the filter on the report is good enough to restrict the data fetch.
Such as:
"SELECT COL1, COL2 FROM Table WHERE Date_Column > " & Start_date
2. Usually not. As long as you don't get a warning about an operation not supporting direct query you are fine. Power Bi will append a where clause to the end of your query when filtering happens.
E.g. if your query is:
SELECT A FROM B.
Then when a user of the report click a filter, Power Bi will do something like:
SELECT * FROM ( SELECT A FROM B) WHERE B == 'ABC'