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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
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.