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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
masplin
Impactful Individual
Impactful Individual

Power query CDS feed select fields statement like you can with SQL?

Hi. I'm new ot using Odata and CDS conenctions but wondering if there is a way to just select given fields liek you can with an SQL query using SELECT and a list of field name from given DB? 

 

Currently I just have this that pulls every field then I remove most of the columns. seems very wasteful

 

let
Source = Cds.Entities("https://wxxxxxxxxxx.api.crm11.dynamics.com", [ReorderColumns=true, UseFormattedValue=true]),
entities = Source{[Group="entities"]}[Data],
acg_wtevents = entities{[EntitySetName="acg_wtevents"]}[Data]
in
acg_wtevents

 

Any advice appreciated

 

Mike

6 REPLIES 6
mahoneypat
Employee
Employee

It looks like you can use the web connector instead of Cds.Entities() and then use the OData protocol, which includes using $select to define the columns you want (I haven't done this yet but it looks doable).

Query Data using the Web API (Microsoft Dataverse) - Power Apps | Microsoft Docs

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


masplin
Impactful Individual
Impactful Individual

Ok so this bit might work for pulling certian fields 

 

GET [Organization URI]/api/data/v9.1/accounts?$select=name,revenue

 

i havenoidea howI use GET in Power Query, but will investigate

 

Thanks

 

i'm using the CDS because need ot extract the display vlaues of some fields insteadof numerical values. 

 

 

Web.Contents() does a GET unless you specify a data payload in which case it does a POST.

v-lionel-msft
Community Support
Community Support

Hi @masplin ,

 

This idea can not be realized in the PowerBI connector in current version. Try to get the columns you want directly from the data source (filter in the data source).

 

Best regards,
Lionel Chen

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

lbendlin
Super User
Super User

here's the ODATA query reference. Query options overview - OData | Microsoft Docs

masplin
Impactful Individual
Impactful Individual

I think the odata ref is about filtered the rows of date not controlling whihc fields to recover.  i have 50+ columns of data but only need 2 or 3 so seems a waste of resources. Seems a massive oversight?

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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