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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
SNDG
Frequent Visitor

Snowflake query variables not working in Power BI

Hi,

 

I need urgent help in the below scenario.

 

For each month there will be one table in database.  In my report always required latest month data, for that I need to define table name dynamically based on currentdate in snowflake query.

I have created query like below using variable, it is working in snowflake server, but not working in Power query editor.

 

SET V_Mon = (Select 'xxx.DDD_' || Monthname(Current_Date) From Dual)
Select * From table($V_Mon)

 

Can some one help me how to acheive it.

 

Thanks in advance

2 REPLIES 2
v-yalanwu-msft
Community Support
Community Support

Hi, @SNDG ;

Is your problem solved? If so, kindly mark the proper reply as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

v-yalanwu-msft
Community Support
Community Support

Hi, @SNDG ;

we can enter the sql statement when we connect to the database in power bi desktop.

vyalanwumsft_0-1658738420537.png

https://community.powerbi.com/t5/Power-Query/Use-advanced-power-query-editor-to-use-SQL-statement/td...


Best Regards,
Community Support Team _ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors