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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
srbh24
Frequent Visitor

Automatic data source switching based on user login

I am working on Embedding a power BI dashboard on a client website, but the data source must automatically be changed depending on the logged in user. How can I acheive this? 

2 REPLIES 2
srbh24
Frequent Visitor

Hi @v-zhouwen-msft

Thank you for sharing that solution. But how can we dynamically retrieve the user's email address in Power query ?, since there is no native function to do that. I know that in case of DAX function we can use UPN to get the email address of the logged in user.
But, for Power query is there any workaround. I have looked everywhere but have not found anything related to it. 

v-zhouwen-msft
Community Support
Community Support

Hi @srbh24 ,

For your question, I think you can create a table that stores the user's email address and the data source connections that can be accessed. Dynamically get the email address of the user who logged in to the service in Power Query. Use ‘Table.SelectRows’ in Power Query to filter the tables that store the user's email address and the data source connections. Create a parameter, stores filtered connection information. Use this parameter to create a connection to the data source.

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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