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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Laura_Saoirse
Frequent Visitor

Help - Code to limit volume of data from CRM

My dash is pulling All Time data from the CRM in to PowerBI which is causing the dash to be extremely slow in development. I want to limit the amout of data flowing in to Power BI to the prior 2 years plus YTD this year. I have found a version of the code below online which I've edited to my use case however I am getting an error ('common token expected'). As a newer user to PowerBI, I dont know where I've gone wrong - any help greatly appreciated! 

 

let
Source = OData.Feed("https://goal.api.crm4.dynamics.com/api/data/v8.2/"),
#"Year" = Date.Year(DateTime.LocalNow())-3,
mh_donations_table = Source{[Name="mh_donations",Signature="table"]}[Data]
#"Filtered Rows" = Table.SelectRows(#"mh_donations_tablele", each Date.Year([donation date]) >= #"Year")
in
#"Filtered Rows"

 

1 REPLY 1
otravers
Community Champion
Community Champion

You can add filters in an Odata URL. Not sure this applies verbatim to your specific version of Dynamics, but this should be a good place to start:

https://reenhanced.com/2020/odata-cheat-sheet-for-microsoft-dynamics-365-and-common-data-service-(cd...

------------------------------------------------
1. How to get your question answered quickly - good questions get good answers!
2. Learning how to fish > being spoon-fed without active thinking.
3. Please accept as a solution posts that resolve your questions.
------------------------------------------------
BI Blog: Datamarts | RLS/OLS | Dev Tools | Languages | Aggregations | XMLA/APIs | Field Parameters | Custom Visuals

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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