cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
LuisQuedas
Advocate I
Advocate I

How to use the same oData Feeds with different user name and password?

Hi All,

 

I've an oData Feed that returns different data according the user name and Password, (it never returns All data, a business rule), ie., if I connect the URL for the data Feed using the User1, it returns information of Dept1, if I connect URL for the data Feed using the User2, it returns information of Dept2. So, I would like to do the two queries and merge them inside Power BI Desktop.

 

it seems that I can't do that using Power BI Desktop latest release, Am I right? or I'm missing something.

 

Many Thanks, Luis

3 REPLIES 3
ImkeF
Super User
Super User

Not sure if I understood your request correctly, but you could do the following:

Create a table where the first column contains the Username and the second the password. Then add a column that performns the call. In there, use the references to your first 2 columns like this:

 

myUrlpart..UsernameFollowing:"&[Column1]&"....PasswordFollowing:"&[Column2]&"

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Hi Imke, thanks for your reply.

 

let me try to be more clear,

 

I've a oData Feed URL:  https://myServer/MyAPI, it uses basic authentication, the data retrieved depends on the user/password I use to connect the Feed.

As an example, imagine I've a user1, when I use it to connect the oData Feed,  the data table retreived only data from Department 1, the department that user1 belongs to. Then I've a second user,  user2, when I use it to connect the oData Feed,  the data table retreived only data from Department 2, the department that user2 belongs to.

Finnaly I want to merge the two data tables inside Power BI.

 

I.e. , I need to get data twice from the same https://myServer/MyAPI, but using different User/Password. (i.e., add two oData feeds  to my Power BI file, using the same URL, but different user and password)

 

Hope I made it more clear now.

 

Many Thanks, Luis

Hi Luis,

So you have the Username and the Password as part of you URL, like this i.e.?:

 

"https://myServer/MyAPI/MyUsername/MyPassword"

 

Then you have to write your modified URL-string in your added column like this:

 

 

"https://myServer/MyAPI/"&[Column1]&"/"&[Column2]&""

 

So you replace the strings with the username and password by a reference to your columns.

 

Please have a look at this example, where a similar thing is done for a paginated URL, where the page numbers are the variables. In your case you 2 columns are your variables/parameters:

 

http://community.powerbi.com/t5/Desktop/how-to-create-a-query-that-paginates/m-p/95843#M40384

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors