Forum Discussion

vsethireuters's avatar
vsethireuters
New Member
9 years ago
Solved

Calling a stored procedure before calling a view in sql server

Hi there    I am new to PowerBI and am hoping you could help with my proof of concept here.    I need to load data for a report by calling a view but beforee that need to authentciate and create ...
  • Anonymous's avatar
    Anonymous
    9 years ago

    Hi vsethireuters,

     

    Based on test, Eric’s solution works on my side, you can refer to below steps:

     

    1. Use import data mode to connect SQL server.

     

    2. Open the query editor, open the advanced editor, copy the code of source.

     


    3. Add a new blank query, paste source code and modified to below query.

     

    let 
        SQLSource = (SPName as text, param as text) => 
    let
        Source =  Sql.Database("xxxxxx", "xxxxx", [Query="exec "&SPName&" '"&param&"'"])
    in
        Source
    in
        SQLSource

     

     

     

    4. Fill in the parameters and click on invoke button.

     


     

    Notice: Eric’s solution not work on direct query mode.

     

    Regards,
    Xiaoxin Sheng