Showing results for 
Search instead for 
Did you mean: 
Helper III
Helper III

Passing the datasource user name and password in M Code - Power Query

When I connect to database in power BI, I get the database driver and database name in Source step of power query formula, When I run the same M code in any other/remote system Power BI is prompting for the database credentials to conenct to database.


But my requirement is to when I use the M code in any other system Power BI shouldn't ask me for the login credentials, for this I have tried to various connection options like Oracle Driver, ODBC, OLE DB but nothing seems to work.


Can experts suggest me the approach to pass the login credentials with in the Source of power Query or make the M Code to use any active/Live connection in application.



Super User III
Super User III

Hello @siva_powerbi 


whenever Power BI needs a logon, it asks for it. You cannot hardcode any password in Power BI

If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun


Thanks for the answer,


Can you please help if we can use any active/Live connection to use in M Query code when integrating M Query in a power shell. So that we can avoid giving user name and password in M Query.

Hello @siva_powerbi 


sorry, I cannot follow you. You would like to have a Live-connection to a datasource where credentials are needed. This means whenever somebody needs to update your datamodel, he needs to have credentials for it. I don't know what power shell here can change.





Helpful resources

PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!


Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors