Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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
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
User | Count |
---|---|
116 | |
73 | |
58 | |
49 | |
48 |
User | Count |
---|---|
171 | |
122 | |
60 | |
59 | |
56 |