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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
pcardno
Frequent Visitor

Using the USERNAME() function in a calculated column to create a dynamic link URL

Hi,

First time poster, long time reader, so apologies if I miss something in my description.

 

Summary:

I want to create a unique web link in a column that contains values from other columns and the user's username for a 3rd party system, but am struggling to use the username() function as the link in each row as it can't be used in a calculated column.

 

Detail:

I have an application that reads data from a SQL Server DB. If the data is in a certain state, I want to create a link to our JIRA system to populate a Create Ticket page with all the relevant details. All good, except that I need to change the username in the URL to be that of the current user in Power BI.

 

Example table (SimulatedMainTable):

 

Parameter1Parameter2Parameter3JIRALinkUserNameMeasure
abchttp://jira.mysite.com/CreateTicket?param1=a&param2=b&username=myusernameuk003119@site.com
defhttp://jira.mysite.com/CreateTicket?param1=d&param2=e&username=myusernameuk003119@site.com
 
The formula I have in there is this:
 
JIRALink = "http://jira.mysite.com/CreateTicket?param1=" & SimulatedMainTable[Parameter1] & "&param2=" & SimulatedMainTable[Parameter2] & "&username=myusername"
 
And I want to change the "myusername" to be the result of the USERPRINCIPALNAME() function, but can't because that needs to be a measure. If I create a measure and link it in, that's fine as long as I don't try to use the other values from the rows, as then it gets confused and says they're not supported.
 
Is this something that's doable? Happy to add any more details or examples as required, plus consider any options e.g. coding it some other way.
 
 
Paul.
1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

Hi @pcardno 


You can create a Masure like.

SELECTEDVALUE( table[hlColumn] ) & USERPRINCIPALNAME()

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

View solution in original post

2 REPLIES 2
Mariusz
Community Champion
Community Champion

Hi @pcardno 


You can create a Masure like.

SELECTEDVALUE( table[hlColumn] ) & USERPRINCIPALNAME()

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
Mariusz Repczynski

 

Hi @Mariusz ,

 

That worked, thank you. Unfortunately, it looks like the performance of the function call when applied across a few thousand rows isn't going to work (it just hangs on more than a couple of rows in the table) but your solution did what I was asking for.

 

Thanks again,

 

 

Paul.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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