Forum Discussion

manoj_0911's avatar
manoj_0911
Kudo Commander
1 year ago
Solved

Help Needed: Passing Dynamic Parameters to SQL Stored Procedure in Power BI

Help Needed: Passing Dynamic Parameters to SQL Stored Procedure in Power BI   Hi Community,   I am working on a Power BI project and need help with calling a **SQL stored procedure** dynamically ...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi manoj_0911 ,

    Please refers to the following steps.

    1.Open the Power Query editor and click Manage Parameters -> New to create a new parameter.

     

    2. Create parameters in the Manage Parameters dialog box.

     

    3.Then connect to the SQL Server database.

    In this SQL statement, the procedure name is followed by a series of values that correspond to the procedure parameters.

    EXEC <YourProcedureName> 'Agent_Details','Group1,Group2','2024-08-01','2024-09-01'


    4.After importing the data, go to the Power Query Editor again and open the Advanced Editor for the query you just imported, and copy the M code I provided earlier.

     

    Best Regards,
    Dengliang Li

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