Using Snowflake's Query_Tags in Power BI?

Viewed 236

We're trying to leverage Snowflake's query_tags within Power BI. This will allow us to drill into the overall costs by report/workspace. Has anyone been able to implement this? Seems like a logic addition.

When we try to add the following SQL to our reports and we're getting an error.

ALTER SESSION SET query_tag = 'Workspace - Report';
SELECT 
  *
FROM Some_view

We know that PBI doesn't like the semicolon at the end of the Alter session statement but removing it also throws a similar error.

The SQL runs without issue when removing the Alter Session statement.

1 Answers

Workaround: Assuming that a separate user is used from PowerBI to connect to Snowflake, the QUERY_TAG could be set up on the user level instead.

QUERY_TAG

Type Session — Can be set for Account » User » Session

For instance:

ALTER USER user_name_here SET query_tag = 'Workspace - Report';

Thus no need to alter session from Power BI.

Related