Unfortunately parameters are not dynamic at this point. So from my knowledge, I don't know of a way to do what you're looking for. Maybe the others will know more.
I think you can achieve this and you need nor require to depend on Parameters,
I am written a similar post ( not on the same ground ) but it can be useful in your case.
Please have a look and let me know if you have any question
So if you are using server, you can set the parameter value by passing it in the URL, which might work for you. I'm not sure how you could use the USERNAME() function within this, but you should know the user name from them logging in, so you can pass that via the parameter URL.
In the attached GIF, the Dashboard was loaded to server with the Parameter set to "Central", but by passing the value "East" in the URL, you can see it sets to "East" on load.
Hope that helps
URLParameter.gif 339.9 KB
Thanks, Simon for the response.
Yes, I have tried this approach, but there is no way browser can get the username unless JS is used.
The way which I have is to embed this dashboard in a webpage, which has some JS code to get the username and then adding that username in embed URL, just like you did.
But, to maintain the same user experience, we have other dashboards on tableau server, introducing a webpage for just 1 dashboard is not the good user experience.
What I want is to have any workaround, which can help me in selecting the username from the parameter based on logged in user.
2 of 2 people found this helpful
Consider a calc field that interacts with your parameter.
Add a value to your parameter list at the top: "None Selected".
Then you can have a calc like this:
IF [Name Parameter] = "None Selected" then FULLNAME()
else [Name Parameter]
FULLNAME gives you the name of the current user, in the format "Last, First". (And if that doesn't match your data's format, you can use string manipulation to reformat it.)
Publish your workbook with "None Selected" as the default value for the parameter. The user will therefore start off with himself as the starting name (if you use the new calc instead of the parameter throughout your application.) But as soon as he selects a name, the calc will switch over to the selected name.