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
stan_w_gifford
Frequent Visitor

FIlter data on retrieve

Good morning from an extremely wet Sydney Australia.

 

I am developing a report where I would like to retrieve data from Dynamics (Dataverse) based on a smaller table from dataverse.

 

I have a table that has a number of GUID entries which point to Sales orders in CRM. The Guids in the smaller table will have duplicates.

 

I would only like to retrieve from Dataverse those orders that match the GUID's in the smaller table.

 

The goal is to refresh the data much quicker - I would only need to retrieve about 1% of the order data - the order table is huge.

 

Is there any way to construct the retrieve that anyone can advise on?

 

Stan

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @stan_w_gifford ,

 

I think Dataverse supports SQL query. You can add filter by SQL query like select ... from... in Advanced in Power Query Editor.

Here are some similar threads for your reference:

Pre-Filtering Data before Importing

Filetring my table before importing in PowerBi

 

Best Regards,
Rico Zhou

 

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

View solution in original post

4 REPLIES 4
stan_w_gifford
Frequent Visitor

I did find out a partial solution using TDS.

 

For example if I just want salesorders which were created after 2021-01-01, I found that using the current version of PBI Desktop, the sequence is......

1. CLick Dataverse

2. Select environment

3. Select Salesorder - Then hit transform data

4. Then select Advanced editor

Replace EVERYTHING that is presented with something like

 

 

let Source = CommonDataService.Database("yourenvironment.crm6.dynamics.com"),
DataverseSQL=Value.NativeQuery(Source,"Select * from salesorder where createdon > '2021-01-01'",null,[EnableFolding=true])
in
DataverseSQL

 

STan

Hi Stan,

 

Did you mange to make this work?

 

when I'm working with dataverse my pipeline is usually Datavers -> PowerBI Dataflow -> PowerBI

 

Because i noticed that the basice "cleaning" like column selection, and let's say a status filtering, are faster in the dataflow (furthermore, like this we are not querying the dataverse with 100 reports 😄 )

 

I'm also facing your same issue, that it would be good to have some more effective folding method, and not so headscratching as using the XMLfetch tool to pre-filter the dataverse query.

 

Unfortunately what you wrote here above, is not working for me (tested on the standard account entity/table)

 😕

 

Regards,

Oliver

Hi,

I didn't go much further on this - I found that using TDS was sufficient for my purposes.

 

PowerBI Data Flow is a new one on me - sounds like some research may be warranted.

 

All the best

 

Stan

v-rzhou-msft
Community Support
Community Support

Hi @stan_w_gifford ,

 

I think Dataverse supports SQL query. You can add filter by SQL query like select ... from... in Advanced in Power Query Editor.

Here are some similar threads for your reference:

Pre-Filtering Data before Importing

Filetring my table before importing in PowerBi

 

Best Regards,
Rico Zhou

 

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

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.