The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi,
In Power Bi for Data entities from D365 F&O I am using OData. But cross-company=true is not working.
I am getting following error:
Details: "Microsoft.Mashup.Engine1.Library.Resources.HttpResource: Request failed:
OData Version: 3 and 4, Error: The remote server returned an error: (400) Bad Request. (An error has occurred.)
OData Version: 4, Error: The remote server returned an error: (400) Bad Request. (An error has occurred.)"
How to resolve?
When working with Data Entities from Dynamics 365 Finance and Operations (D365 F&O) using OData in Power BI and encountering issues with the cross-company=true parameter, it's important to troubleshoot a few key areas to resolve the issue. Here are steps and considerations to help address the "400 Bad Request" error:
Ensure that your OData URL is correctly formatted. The cross-company=true parameter should be added to the query string. For example:
https://<your-dynamics-instance>/data/<EntityName>?cross-company=true
Verify that there are no typos or incorrect characters in the URL.
Ensure that the entity you are trying to access is properly set up for cross-company queries. You may need to verify that the user account used for the OData connection has the necessary permissions to access data across companies.
In D365 F&O, check the configuration of the data entity. Ensure that:
Try accessing the OData URL directly from a web browser or a tool like Postman with the cross-company=true parameter to see if you receive a more detailed error message or if the request succeeds. This can help isolate whether the issue is with Power BI or with the OData service itself.
Ensure that your Power Query M code correctly handles the request. For example:
let
Source = OData.Feed("https://<your-dynamics-instance>/data/<EntityName>?cross-company=true", null, [Implementation="2.0"])
in
Source
Make sure the URL is correctly substituted with your actual instance and entity name.
Confirm that you are using the correct OData version for your Dynamics 365 instance. D365 F&O typically uses OData V4, but there may be specific configurations or requirements for different versions.
Review the official Dynamics 365 documentation to see if there have been any changes or updates regarding the use of OData with the cross-company parameter.
Sometimes issues are due to known bugs or limitations in the platform. Check Microsoft's support forums or service status updates for any known issues related to OData in D365 F&O.
If the problem persists after trying these steps, consider reaching out to Microsoft Support for more detailed troubleshooting. Provide them with the error message, URL, and any relevant details about your environment.
By following these steps, you should be able to diagnose and resolve the issue with the cross-company=true parameter in your OData requests from Dynamics 365 F&O to Power BI.
Hi @Shravan133 ,
Thank you for the detailed response.
Hi @fareehasattar ,
-- OData Version: 3 and 4, Error: The remote server returned an error: (400) Bad Request. (An error has occurred.) ...
This kind of error usually indicates that there is a problem with the syntax or parameters of the request that the client (on your side) is sending to the server, causing the server to be unable to understand or process the request.
I checked the D365 F&O documentation, which indicates support for the cross-company parameter:
By default, OData returns only data that belongs to the user's default company. To see data from outside the user's default company, specify the ?cross-company=true query option. This option will return data from all companies that the user has access to.
Example:
http://[baseURI\]/data/FleetCustomers?cross-company=true
To filter by a particular company that isn't your default company, use the following syntax:
http://[baseURI\]/data/FleetCustomers?$filter=dataAreaId eq 'usrt'&cross-company=true
Open Data Protocol (OData) - Finance & Operations - Cross-company behavior
Could you show us the format of your OData URL after erasing the privacy?
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi Gao,
This is the format I am using
https://<your-d365fo-instance>/data/<dataentityname>?cross-company=true
The problem is that it is not even working in browser. Also, the same format is working for other data entity. But there is no apparent difference in the properties of data entities itself.
Hi @fareehasattar ,
What if you change the protocol from https to http?
Open Data Protocol (OData) - Finance & Operations | Dynamics 365 | Microsoft Learn
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum