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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Vinay96
Helper I
Helper I

Pass User ID from Report Builder to Store Procedure

Hi; I know there is a Built in fields in Power BI Report Builder to get the logged in Username or User ID. What I need to do is pass the value of User ID to SQL to execute a stored procedure that will bring the correct dataset based on the permissions that user has in the database. Hope someone can suggest a way around this issue

3 REPLIES 3
Vinay96
Helper I
Helper I

Thanks, Can you pls provide the query in the Store Procedure to accept the User ID 


@Vinay96 wrote:

Thanks, Can you pls provide the query in the Store Procedure to accept the User ID 


I don't have any query. You asked how to pass a value to a stored procedure and I've showed you the steps to do this. You can put whatever logic you like in the stored procedure based on whatever data you have in your database.

d_gosbell
Super User
Super User

If you pick the stored procedure option in the dataset properties, then navigate to the parameters settings it should list all the parameters for your stored procedure. 

d_gosbell_0-1681262981434.png

 

You can then click the fx button to add an expression and choose the UserID from the Built-in Fields

d_gosbell_1-1681263026237.png

 

You will end up with a parameter setting that looks like the following and will pass the UserID value from the paginated report to your stored procedure

d_gosbell_2-1681263065245.png

 

 

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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

Top Solution Authors