Forum Discussion

wskallmeyer's avatar
wskallmeyer
Advocate II
9 years ago
Solved

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

5 Replies

  • v-caliao-msft's avatar
    v-caliao-msft
    Microsoft Employee

     

    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.

     

    Regards,

    Charlie Liao

  • Ramchander's avatar
    Ramchander
    Frequent Visitor

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

     

    I am also trying to solve the same issue. Did you find any workarounds? 

    Does this work with Oracle database?? Please share your finding.

    Thanks,

    Ram