Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
jersey417
Helper I
Helper I

Snowflake's Query_tag functionality in Power Query?

I'm currently trying to implement Snowflake's Query_Tag functionality within a number of reports to start tracking associated costs down to the workspace/report level.  I'm able to implement the following in Snowflake's Worksheets and the query run successfully. The query tag is loaded as expected in Snowflakes history query tag field. 

 

Example of the SQL currently being used;

---

ALTER SESSION SET QUERY_TAG = 'Workspace - Report';

SELECT  * 

FROM View

--- 

 

However, when I try to load the following SQL into the snowflake connector I get the following error.

jersey417_0-1636391391159.png

 

I'd like to understand how to implement this via a native connect if possible. Has anyone had success getting this to work? 

 

 

7 REPLIES 7
Franck_ecocert
Frequent Visitor

I'am interested too. I tried to pass an ALTER SESSION statement in the connection (with or without semicolon) :

 

Franck_ecocert_0-1673014767480.png

 

But I have this error : Expression.Error: Native queries aren't supported by this value.

However I have a query in my Snowflake account 

Franck_ecocert_1-1673014952824.png

I don't understant why Power BI encapsulate my query in a select * FROM ?

Anonymous
Not applicable

Anonymous
Not applicable

Did anybody get this to work?

No - The Snowflake connector needs to be updated to allow for the following.

scottdigs
Frequent Visitor

I'm also interested in a solution for this for tracking reporting costs. In Tableau we can use 'Initial SQL' to accomplish this. However, Power BI seems to lack this functionality.

jersey417
Helper I
Helper I

@v-eqin-msft 

 

Thanks - Both of those options are not resolving the issue.  When we move the semicolon it causes additional errors. 

jersey417_0-1636638721170.png

 

v-eqin-msft
Community Support
Community Support

Hi @jersey417 ,

 

1.It may casued by the semicolon in the end of the query,please delete it.

2. Please try @YMadden 's suggestion provided in this thread: Fully qualifying the table names as dbname.schemaname.tablename

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors