Reply
Regular Visitor
Posts: 19
Registered: ‎02-09-2017
Accepted Solution

use dax to set parameter value

I would like to create a parameter and set the value to the username value.  Is that possible?  Or is their alternative work around?

 

Ultimately I want to filter several queries with my Power BI desktop file based on the user's username.

 

Thanks in advance,

 

Scott


Accepted Solutions
Moderator
Posts: 1,031
Registered: ‎03-06-2016

Re: use dax to set parameter value

@wskallmeyer,

 

We upload Power BI report to Report server now. And we can view this Power BI report on Report Manager directly. Please refer to the link below. There are some limitation on it currently, you can only use on-premise SSAS database as the Power BI report datasoure.
https://docs.microsoft.com/en-us/sql/reporting-services/power-bi-reports-in-reporting-services

Regards,

Charlie Liao

View solution in original post


All Replies
Super Contributor
Posts: 1,028
Registered: ‎07-27-2016

Re: use dax to set parameter value

how are the users accessing this via the desktop or via the power bi service?  I personally dont know of a way to grab the username of a user dynamically in the desktop, but if you using the power bi service you can use row level security 

 

 

https://powerbi.microsoft.com/en-us/documentation/powerbi-admin-rls/

Moderator
Posts: 1,031
Registered: ‎03-06-2016

Re: use dax to set parameter value

 

@wskallmeyer,

 

We can take advantage of the DAX function username() within your dataset. We can use it within expressions in Power BI Desktop. When we publish your model, it will be used within the Power BI service. Within Power BI Desktop, username() will return a user in the format of DOMAIN\User. Within the Power BI service, username() will return the user's User Principal Name (UPN). This looks similar to an email address.

Capture.PNG

 

Regards,

Charlie Liao

Highlighted
Regular Visitor
Posts: 19
Registered: ‎02-09-2017

Re: use dax to set parameter value

We will using Power BI Desktop an a stand alone file until SSRS is ready to host them. 

Moderator
Posts: 1,031
Registered: ‎03-06-2016

Re: use dax to set parameter value

@wskallmeyer,

 

We upload Power BI report to Report server now. And we can view this Power BI report on Report Manager directly. Please refer to the link below. There are some limitation on it currently, you can only use on-premise SSAS database as the Power BI report datasoure.
https://docs.microsoft.com/en-us/sql/reporting-services/power-bi-reports-in-reporting-services

Regards,

Charlie Liao