cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Markzolotoy
Post Prodigy
Post Prodigy

SQL Select with parameters in DirectQuery mode

Here is my code:

let
Source = Sql.Database("localhost", "DB",
[Query="select id from table#(lf)where name = '"&Name&"'#(lf)and othercondition = 0#(lf)"]),
id = Source[id]
in
id

I get "This query contains transformations that can't be used for DirectQuery."

Is there a way of running sql selects with PB parameters in DQ mode?

 

Thanks

1 ACCEPTED SOLUTION
aj1973
Community Champion
Community Champion

DQ mode connects directly to the source data stays where it is, it doesn't import the data into Power bi engine/power query to make transformation on it. DQ mode doesn't allow trasformations to be made directly on the source just like Live connection mode.

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

View solution in original post

3 REPLIES 3
aj1973
Community Champion
Community Champion

Hi @Markzolotoy 

The answer is simply no, you can't use SQL statemants in DQ mode, it needs Database.

aj1973_0-1624104124669.png

 

 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

What does it mean "requires database"?

aj1973
Community Champion
Community Champion

DQ mode connects directly to the source data stays where it is, it doesn't import the data into Power bi engine/power query to make transformation on it. DQ mode doesn't allow trasformations to be made directly on the source just like Live connection mode.

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

View solution in original post

Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Top Solution Authors
Top Kudoed Authors