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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
powerbiexpert22
Impactful Individual
Impactful Individual

Error while fetching data from stored procedure in Snowflake

i am getting below error which fetching data from snowflake procedure, . procedure is basically display all data from snowflake table . below is the code of snowflake procedure

 
powerbiexpert22_1-1771340418260.png

 



 powerbiexpert22_0-1771340083254.png

 

 

 

 

CREATE OR REPLACE TABLE EMPLOYEE_SAMPLE (
EMP_ID INT,
EMP_NAME STRING,
DEPARTMENT STRING,
SALARY NUMBER(10,2)
);

INSERT INTO EMPLOYEE_SAMPLE (EMP_ID, EMP_NAME, DEPARTMENT, SALARY) VALUES
(1, 'Amit Sharma', 'IT', 75000),
(2, 'Neha Verma', 'HR', 60000),
(3, 'Rahul Singh', 'Finance', 82000),
(4, 'Priya Mehta', 'IT', 90000);

CREATE OR REPLACE PROCEDURE GET_EMPLOYEE_DATA()
RETURNS TABLE (
EMP_ID INT,
EMP_NAME STRING,
DEPARTMENT STRING,
SALARY NUMBER(10,2)
)
LANGUAGE SQL
AS
$$
DECLARE rs RESULTSET;
BEGIN
rs := (SELECT * FROM EMPLOYEE_SAMPLE);
RETURN TABLE(rs);
END;
$$;

 

CALL GET_EMPLOYEE_DATA();

1 ACCEPTED SOLUTION
v-hjannapu
Community Support
Community Support

Hi @powerbiexpert22,

Thank you  for reaching out to the Microsoft fabric community forum.

The problem is coming because Power BI Snowflake connector does not support calling stored procedures using CALL statement in the SQL box. Power BI expects a normal SELECT query, table or view. Since CALL GET_EMPLOYEE_DATA() is not a SELECT statement, Power BI is not able to read the metadata properly and Snowflake throws that compilation error. So this is not a table or permission issue, it is just a limitation from Power BI side. To fix this, you can either create a view on top of the table and use that in Power BI, or convert the logic into a table function, or simply use a direct SELECT query if the requirement is only to display table data.


Hope the above information helps you to resolve the issue. If you still have any questions or need further clarification, please let us know.
Regards,
Community Support Team.

View solution in original post

2 REPLIES 2
v-hjannapu
Community Support
Community Support

Hi @powerbiexpert22,

Thank you  for reaching out to the Microsoft fabric community forum.

The problem is coming because Power BI Snowflake connector does not support calling stored procedures using CALL statement in the SQL box. Power BI expects a normal SELECT query, table or view. Since CALL GET_EMPLOYEE_DATA() is not a SELECT statement, Power BI is not able to read the metadata properly and Snowflake throws that compilation error. So this is not a table or permission issue, it is just a limitation from Power BI side. To fix this, you can either create a view on top of the table and use that in Power BI, or convert the logic into a table function, or simply use a direct SELECT query if the requirement is only to display table data.


Hope the above information helps you to resolve the issue. If you still have any questions or need further clarification, please let us know.
Regards,
Community Support Team.

amitchandak
Super User
Super User

@powerbiexpert22 , As suggested on old post try Native Query

https://community.fabric.microsoft.com/t5/Desktop/Calling-snowflake-stored-procedure-from-Power-Bi-d...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

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.