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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
jplopes
New Member

Filtering Dynamics CRM

Hey there,

I'm importing a data from a Dynamics CRM source. But since it's a pretty big source, it ends up that it gets too slow or even returns with some kind of error.

To solved it, I have selected only couple columns I need.

But now, I need to configure it in a way to bring less data filtering by variable. For example, in a year column (containing 2014, 2015, 2016 ie), I need to filter it only by 2016. I know I could import all data and then use a filter in a next step; but this would load 2014, 2015, which are useless for my analysis.

Follow the code I have changed (its in portugues). The name of the colummns are in green and the name of the table is red.

let
Origem = let
Origem = OData.Feed("https://XXXXXXXX.crm2.dynamics.com/XRMServices/2011/OrganizationData.svc/OpportunitySet?$select=Name, affero_quantidade, affero_Valor, affero_valor_total_oportunidade, CustomerId, OwnerId, new_ProbabilidadedaOportunidadeAberta, affero_produto, affero_bu, new_VendaCross, StepName, StateCode, EstimatedCloseDate, affero_ano, affero_data_retorno"),
OpportunitySet_table = Origem{[Name="OpportunitySet",Signature="table"]}[Data]
in
Origem

 

 

I want something like this: affero_ano = 2016

 

 

Thanks in advance,

Bests,
João Pedro

2 REPLIES 2
Greg_Deckler
Super User
Super User

Hmm, was trying to test this but can't even get the $select syntax to work. I get the error:

 

DataSource.Error: Microsoft.Mashup.Engine1.Library.Resources.HttpResource: Request failed:
OData Version: 3 and 4, Error: The remote server returned an error: (400) Bad Request. (Query options $expand, $filter, $orderby, $inlinecount, $skip and $top cannot be applied to the requested resource.)
OData Version: 4, Error: The remote server returned an error: (400) Bad Request. (Query options $expand, $filter, $orderby, $inlinecount, $skip and $top cannot be applied to the requested resource.)
OData Version: 3, Error: The remote server returned an error: (400) Bad Request. (Query options $expand, $filter, $orderby, $inlinecount, $skip and $top cannot be applied to the requested resource.)
Details:
DataSourceKind=OData
DataSourcePath=https://[tenant].crm.dynamics.com/XRMServices/2011/OrganizationData.svc

 

Which is a bit senseless since all of the things that are mentioned that I cannot do, I'm not doing. My Power Query was simply:

 

let
    Source = OData.Feed("https://[tenant].crm.dynamics.com/XRMServices/2011/OrganizationData.svc?$select=CreatedOn"),
    OpportunitySet_table = Source{[Name="OpportunitySet",Signature="table"]}[Data]
in
    OpportunitySet_table

However, given the error message I am receiving, I am guessing that you cannot use the $filter syntax to pre-filter your ODATA query, which was the path I was headed down:

https://msdn.microsoft.com/en-us/library/hh169248(v=nav.90).aspx



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Has anyone figured out how to filter Dynamics API queries to minimize the data being imported? We have a massive amount of data and it takes forever to do anything.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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