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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Lisi
Regular Visitor

Getting Data via FetchXML from Dynamics

Hi, I'm trying to get data via FetchXML into PowerBI. I followed the steps described in Use FetchXML in Power BI with Dynamics 365 customer engagement | crm chart guy. 
I tried to connect but I always get a message, that the connection ist not possible because the string contains invalid characters. 

The generated URL is: https://xxxx.api.crm4.dynamics.com/api/data/v9.1/accounts?fetchXML=%3Cfetch+version%3D%221.0%22+outp...

I changed the first part of the URL to publish here. Does anybody have any ideas? 

Thanks a lot in advance, Lisi


1 ACCEPTED SOLUTION
5 REPLIES 5
Lisi
Regular Visitor
Anonymous
Not applicable

Hi @Lisi ,

 

Based on this document——How to handle Special Characters in Fetch XML | Microsoft Dynamics 365 CRM Tips and Tricks . Fetch XML is the easiest way to write complex queries to retrieve data by joining multiple entities.

 

We could use webutility.htmlencode(uiname) to handle such an error. For example:

Eyelyn9_0-1647497528925.png

 

Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @Anonymous  - the following "Fetch XML is the easiest way to write complex queries to retrieve data by joining multiple entities" may be true, but Power BI would prefer a Star Schema rather than One Big Table.

@Lisi - I wondering do you need to separate the URL and Relative Path to get the FetchXML to work.  Chris describe this in the Blog - Chris Webb's BI Blog: Using The RelativePath And Query Options With Web.Contents() In Power Query And Power BI M Code Chris Webb's BI Blog (crossjoin.co.uk)

Lisi
Regular Visitor

Hi Daryl, if I get the data the usual way I have to import all kinds of tables and lot's of data. FetchXML would give me the chance to import a smaller amount of data from more than one entity. It would be more like importing a view from sql Server. Or is there another way? Thanks, Lisi

 

Daryl-Lynch-Bzy
Resident Rockstar
Resident Rockstar

HI @Lisi - I would like understand why the standard D365 in Power BI cannot be used?  Why do you need to use the FetchXML?

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors