cancel
Showing results for 
Search instead for 
Did you mean: 
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
RicoZhou
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

RicoZhou
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
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

BizApps LATAM 2023

Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

Power Platform Bootcamp

Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.