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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
viji123
Frequent Visitor

How to pass Current logged in userId to Web API call

Hi,

 

My datasource is a web API.It requires a userid to be passed as a query paramater string.How can i pass the userid of the currently logged-in user to the powerquery code that calls the API?I can see the currently logged in user's name from Username()  DAX function,However I cannot pass this value to powerquery.This is my code snippet.I need to capture the currently logged in user and pass it to EnterpriseId

viji123_0-1638167565578.png

Also, currently , my storage mode is import.Is it possible to change to DirectQuery when source is web API

Appreciate any help.TIA

 

 

1 REPLY 1
v-yingjl
Community Support
Community Support

Hi @viji123 ,

If you want to get the username like using DAX Username() in Power Query, you can refer these articles which introduces some ways to achieve this:

  1. 4 ways to get USERNAME in Power Query 
  2. Get username function in Power Query 

 

In addition, when using Web API, it is not supported to use Direct Query mode in Power BI.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors