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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply

Stored Procedure with Multiple queries definied by one paramter

Hi there

 

Can someone please help me with the below.

 

I have a Stored Proc. Within there are multiple queries which are controlled by the below 3 parameters.

 

@DatasetFlag VARCHAR

@Year INT

@month INT

 

In the FROM Clause from each query within the SP it will say 

FROM dataset_name (@DatasetFlag, @year, @month)

 

Each query is built like this but has different measure and column names containes

 

IF @DatasetFlag = 'Stoke-on-Trent' 
BEGIN
FROM FROM dataset_name (@DatasetFlag, @year, @month) - year and month will need to be parameters too
WHERE 
GROUP BY
ORDER BY 
END;
 
IF @DatasetFlag = 'Manchester' 
BEGIN
FROM FROM dataset_name (@DatasetFlag, @year, @month)
WHERE 
GROUP BY
ORDER BY 
END;
And so on for each different set of datasets - I have about 30 in the same SP and each is different
 
Is it possible to bring this in to Power BI, calling each parameter (dataset flag which controls the local authority I wan to see the results for, the year parameters for the measures relating to that year, and the month parameters for the measures relating to that month and then for it to only show the columns relating to that particular query.
 
Does this make sense? Hope so.
 
Thanks for reading
 
Kind regards
Karen

 

1 ACCEPTED SOLUTION

Thanks @amitchandak 

Unfortunately it didn't really help. I think the ain problem is how Ive built my SPROC. I think if I design it differently I can get the help[ from the post to work 🙂

Kind regards

Karen

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

Thanks @amitchandak 

Unfortunately it didn't really help. I think the ain problem is how Ive built my SPROC. I think if I design it differently I can get the help[ from the post to work 🙂

Kind regards

Karen

Thank you @amitchandak (as usual 😁) I'll take a look

Kind regards

Karen

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.