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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
EJones
Frequent Visitor

Data Set Parameter Not Being Passed to DB Query

I've got a Report Server data set that is sourcing from Netezza.  I need to pull values from a table based on the current user's username.  I've added a @CurrentUser parameter to my query, and I've defined that parameter in the data set options as:

 

=iif(InStr(User!UserID,"\") <> 0, UCase(Right(User!UserID, Len(User!UserID) - InStr(User!UserID,"\"))), UCase(User!UserID))

 

When I try to run my query in Report Builder, I get a Define Query Parameters popup that identifies my @CurrentUser parameter and asks for the Parameter Value and the Data Type.  If I save the data set and try to preview the data on the Report Server, I get an error message that states "The data set could not be processed because it requires non empty parameters". 

 

I guess my first question is whether it is even possible to use the User!UserID function in a data set on the Report Server.  Second, why is it not recognizing that I have defined this parameter in the data set?  

 

 

 

1 ACCEPTED SOLUTION
krisztb
Power BI Team
Power BI Team

Data preview for data sets with parameters has limitations (even when they rely on expressions), but the data sets should work fine once you use them from reports.

I assume you are designing a shared data set. Consider making the @CurrentUser parameter internal if you don't plan to override it from actual reports. Once the data set is saved you can test it by creating a report that uses it. Just build one in Report Builder and hit preview on the report itself.

 

Let me know if you still have problems with data sets.

View solution in original post

3 REPLIES 3
krisztb
Power BI Team
Power BI Team

Data preview for data sets with parameters has limitations (even when they rely on expressions), but the data sets should work fine once you use them from reports.

I assume you are designing a shared data set. Consider making the @CurrentUser parameter internal if you don't plan to override it from actual reports. Once the data set is saved you can test it by creating a report that uses it. Just build one in Report Builder and hit preview on the report itself.

 

Let me know if you still have problems with data sets.

Thanks, I see that it does correctly pass the parameter value through to the query now when creating a KPI.  

 

Follow-up question: Is there a way to make KPIs refresh automatically when someone visits the report server page and have it refresh based off of the username of whoever is visiting?  The values of my KPIs are shown based on the username of the person who created them, but if I log in as a different user, I still see those same values even though I need it to update based on the current user.  

There is a way to have the KPI get latest data using cache refresh plan for the underlying data set: https://community.powerbi.com/t5/forums/replypage/board-id/ReportServer/message-id/5062

 

 

Note that the refresh is time based, you can make the cache expire every minute, but if you want to trigger a refresh each time a user visits the server, you'll need to create a custom solution (e.g. schedule a refresh job using SQL Agent).

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.