Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi.. i'm calling a stored procedure(SQL) in powerbi using direct query it is executed successfully by passing value manually. Now i'm trying to execute the value using parameter option in powerbi , so when i pass the value to powerbi and execute, it throws me an error "DataSource.Error: Microsoft SQL: Error converting data type nvarchar to uniqueidentifier." . Is there any way we can convert it to uniqueidentifier. Any help would be appreciated.
Solved! Go to Solution.
We can use parameter when call store procedure. Smaple query for you reference.
let SQLSource = (param1 as date, param2 as date) => let Source = Sql.Database("servername", "databasename", [Query="exec p4test '"& Date.ToText(param1) & "','" & Date.ToText(param2)&"' #(lf)#(lf)#(lf) #(lf)"]) in Source in SQLSource
Regards,
Charlie Liao
We can use parameter when call store procedure. Smaple query for you reference.
let SQLSource = (param1 as date, param2 as date) => let Source = Sql.Database("servername", "databasename", [Query="exec p4test '"& Date.ToText(param1) & "','" & Date.ToText(param2)&"' #(lf)#(lf)#(lf) #(lf)"]) in Source in SQLSource
Regards,
Charlie Liao
@anudeep3721 Pass the text and do the conversion of the value in the stored procedure. That would probably be the most straight forward.
User | Count |
---|---|
34 | |
21 | |
20 | |
14 | |
12 |
User | Count |
---|---|
26 | |
19 | |
18 | |
18 | |
14 |