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
Hi Experts,
I'm connecting to an Azure SQL Server database in Direct Query Mode:
Then, I'm creating SQL sentences to import the tables with Value.NativeQuery:
let
Source = Value.NativeQuery(#"SQL/mydatabase database windows net;mydatabsae","
SELECT *
FROM TABLEA A
INNER JOIN TABLEB ln on ln.KEY = A.Key
INNER JOIN TABLEC gc on gc.id = A.Key
")
in
Source
Then, I create all the relations between the tables in order to create my Star model. When I create the report, it is not working as I can not see the data, instead I've got this error:
Is it because the value.nativeQuery() statement?
Is it possible to create a model with relations between tables and creating my own querys to combine data with Direct Query On?
Is it strictly necessary to use composite models? I've been reading the documentation and I just want to be sure about it.
I am working with compatibility level: SQL Server 2017 / Azure Analysis Services (1400)
Thanks
Solved! Go to Solution.
There is a trick that worked to me:
-First of all, you need to create your model with the property "Direct Query Mode: Off".
-Then, If you want to create your own query, it is necessary to use Sql.Database()
let
Source = Sql.Database("MyConection", "DATABASE", [Query="
select * from your_table
.......
"])
in
Source-Once you import tables and create all relations between them, switch to "Direct Query Mode: On"
That's it... it should work!
There is a trick that worked to me:
-First of all, you need to create your model with the property "Direct Query Mode: Off".
-Then, If you want to create your own query, it is necessary to use Sql.Database()
let
Source = Sql.Database("MyConection", "DATABASE", [Query="
select * from your_table
.......
"])
in
Source-Once you import tables and create all relations between them, switch to "Direct Query Mode: On"
That's it... it should work!
I would think that using Value.NativeQuery() will prevent query folding from working - which makes Direct Query a bit pointless.
Try loading your three tables independently and then let the DAX data model do the joins for you.
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 |