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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

JWT token generation and filter the data as per the username logged

Hi All,

 

I have a scenario where i need to generate the JWT token in power BI with the username logged into Power BI acccount and then call an API with this token to get data.

Based on the username logged into Power BI which is sent via JWT, We need to filter the data.

Could you please suggest a way to do this and also the code used for the same?

 

Thanks in Advance:

Nishanth

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

Did you mean Row-level security (RLS) with Power BI? Please refer to the online document.

https://docs.microsoft.com/en-us/power-bi/service-admin-rls

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

Hi @v-frfei-msft 

 

No, Am not looking into RLS for now.

In power BI, I need to generate the App token which has username details encoded in it. When a Single API with this token is called we will receive the data based on the username in the set token. Please specify a way to do this.

I tried Running R script in "Get Data" option then generated the token. But issue i found is i cant pass the value of userprinciplename() i,e logged in user of power BI to R script.

 

Thank you:

Nishanth

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors