Forum Discussion
Parameters for Source and Environment in Power Query
Hi PRV ,
Thnaks for reaching out to Microsoft Fabric Community.
Just checking in to see if you were able to resolve your query. If not, please consider the following:
It appears the issue is rooted in how Power BI handles DirectQuery mode with dynamic parameters. Specifically, using expressions like ENVIRONMENT & "_CONSUMPTION" within the Snowflake.Databases() step causes Power BI to lose track of static metadata, which is required for DirectQuery to function correctly. As a result, it defaults to Import mode.
To maintain DirectQuery behavior:
Avoid metadata navigation steps like Source{[Name="..."]}[Data] when using dynamic parameters.
Instead, try using a native query with fully qualified table names:
let
Source = Value.NativeQuery(
Snowflake.Databases("pistor.west-europe.azure.snowflakecomputing.com", null, [Role = SF_ROLE]),
"SELECT * FROM " & ENVIRONMENT & "_CONSUMPTION.LOGISTIK.YourTableName",
null,
[EnableFolding = true]
)
in
Source
After loading the query, go to Query Properties and check “Don’t allow changes to connection settings” to lock it to DirectQuery.
If It Still Doesn’t Work
Try testing in Dataflows Gen2 in Microsoft Fabric, which can sometimes offer more control over parameter handling.
Alternatively, structure your query as a Power Query function that takes ENVIRONMENT and SF_ROLE as inputs rather than parameters hardcoded into steps.
If you're still stuck after trying the above, please let us know.
Hope this helps. Please reach out for further assistance.
If this post helps, then please consider to Accept as the solution to help the other members find it more quickly and a kudos would be appreciated.
Thank you.
- v-veshwara-msft1 year agoCommunity Support
Hi PRV
Following up to see if your query has been resolved. If any of the responses helped, please consider marking the relevant reply as the 'Accepted Solution' to assist others with similar questions.
If you're still facing issues, feel free to reach out.
Thank you.