Forum Discussion
Can't create relationships between Snowflake tables when using DirectQuery or Composite Models
- 1 year ago
Hi ketchum
This error typically occurs when Power BI tries to generate a SQL query that involves tables with different storage modes (Import and DirectQuery) and fails to perform query folding.In other words, it cannot efficiently combine data from an Import-mode dimension table with a DirectQuery fact table through SQL. This doesn’t mean relationships don’t work — it just highlights the limitations of using Import and DirectQuery tables together in visuals, especially when Power BI can’t translate the visual into a valid backend SQL query.
You can try a work around: Use Dual storage mode instead of Import for your dimension tables
-
Right-click on the dimension table in the model
-
Select “Storage Mode” → Choose Dual
This allows the table to behave as either Import or DirectQuery depending on the context of the query, which often resolves join/folding issues in visuals.
You can try Enable the Performance Analyzer in Power BI to inspect the generated query and understand whether the issue is in the visual, the measure, or the data model.
Let me know what happens! -
- 1 year ago
Hi ketchum,
Thank you for reaching out to Microsoft Fabric Community.
Thank you marcelsmaglhaes for the prompt response.
You cannot change an Import-mode table to Dual directly, please remove the dimension table and re add it as DirectQuery, and then change its storage mode to Dual. This allows power bi to optimize execution and resolve many folding and join issues.
- If you are using snowflake via ODBC, consider switching to the native Snowflake connector, it provides better support for DirectQuery and query folding.
- Also use single-directional relationships where possible, try using the basic one 1:many relationships, avoid bidirectional filtering unless necessary.
- Use Performance Analyzer, it helps to identify which part of the query is causing folding or performance issues.
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thanks and regards,
Anjan Kumar Chippa
Hi ketchum
This error typically occurs when Power BI tries to generate a SQL query that involves tables with different storage modes (Import and DirectQuery) and fails to perform query folding.
In other words, it cannot efficiently combine data from an Import-mode dimension table with a DirectQuery fact table through SQL. This doesn’t mean relationships don’t work — it just highlights the limitations of using Import and DirectQuery tables together in visuals, especially when Power BI can’t translate the visual into a valid backend SQL query.
You can try a work around: Use Dual storage mode instead of Import for your dimension tables
-
Right-click on the dimension table in the model
-
Select “Storage Mode” → Choose Dual
This allows the table to behave as either Import or DirectQuery depending on the context of the query, which often resolves join/folding issues in visuals.
You can try Enable the Performance Analyzer in Power BI to inspect the generated query and understand whether the issue is in the visual, the measure, or the data model.
Let me know what happens!
Thanks for the response marcelsmaglhaes. I'll give the Performance Analyzer a try.
I can't select/change the Storage mode on my dim tables that are currently brought in via Import mode on the composite model, but I can change it for the fact table that is brought in via DirectQuery:
Oddly, I get the same behavior (unable to utilize relationships to build visuals) if I bring all the dim/fact tables in via DirectQuery mode, too. So anytime DirectQuery is involved, I'm seeing issues.
😵💫