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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
saranrajk
Helper II
Helper II

Get the data from dataset by passing parameters to Stored procedures?

Hi,

I'm trying to get data from the shared dataset by passing parameters and I'm calling stored procedures through the dataset.

 

When I'm trying the access the data from the dataset using parameters I'm getting the following error,

The value for parameter 'ItemPath' is not specified. It is either missing from the function call, or it is set to null.
The following is my stored procedure is MSSQL
CREATE PROCEDURE TEST_PROCDURE (@ProductName as VARCHAR(100),@BrandName as VARCHAR(100),@StoreName VARCHAR(100),@CityName VARCHAR(100))
AS
BEGIN
if ((@ProductName IS NOT NULL) AND (@BrandName IS NULL) AND (@StoreName IS NULL) AND (@CityName IS NULL))
BEGIN
select PRD.PRODUCT_NAME,sum(PRD.LIST_PRICE)
from BikeStores.production.products PRD
where PRD.PRODUCT_NAME = @ProductName
group by PRD.PRODUCT_NAME
END
else if ((@ProductName IS NULL) AND (@BrandName IS NOT NULL) AND (@StoreName IS NULL) AND (@CityName IS NULL))
begin
select BRND.brand_name,sum(OITM.list_price)
from BikeStores.production.brands BRND
join BikeStores.production.products PRD on BRND.brand_id = PRD.brand_id
join BikeStores.sales.order_items OITM on PRD.product_id = OITM.product_id
where BRND.brand_name = @BrandName
group by BRND.brand_name
end
else if ((@ProductName IS NULL) AND (@BrandName IS NULL) AND (@StoreName IS NOT NULL) AND (@CityName IS NULL))
begin
select STS.store_name,sum(OITM.list_price)
from BikeStores.sales.stores STS
join BikeStores.sales.orders ORD on STS.store_id = ORD.order_id
join BikeStores.sales.order_items OITM on ORD.order_id = OITM.order_id
where STS.store_name = @StoreName
group by STS.store_name
end
else if ((@ProductName IS NULL) AND (@BrandName IS NULL) AND (@StoreName IS NULL) AND (@CityName IS NOT NULL))
begin
select STS.city,sum(OITM.list_price)
from BikeStores.sales.stores STS
join BikeStores.sales.orders ORD on STS.store_id = ORD.order_id
join BikeStores.sales.order_items OITM on ORD.order_id = OITM.order_id
where STS.city = @CityName
group by STS.city
end
END;
 
Following is the screenshot my shared dataset and parameters.
Stored procedureStored procedure
Parameters of stored procedureParameters of stored procedure
 
Following is the screen shot of calling it from postman
calling it from postmancalling it from postman
 
 
0 REPLIES 0

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.