Retrieving only specific columns over ODATA when querying Microsoft NAV
Hey,
My question is pretty straightforward, though it's more about Power Query than PowerBI - How can I retrieve only specific columns when connecting to Microsoft NAV via ODATA connection? My query works as it is but it wastes a lot of time first retrieving the whole table and then dropping unneeded columns, with around 95% of the data retrieved being dropped at this stage. In short, I'd like to pass the columns I keep at the step "Removed Other Columns" when I query for the data in the first step.
MyCompany_ODATA = OData.Feed("https://MyNAVsLocation/POWERBI/odata/Company('MyCompany')/", null, [Implementation="2.0"]),
MyCompany_Raw = MyCompany_ODATA[GLRawTable],
"Removed Other Columns" = Table.SelectColumns(MyCompany_Raw ,{"G_L_Account_No", "Posting_Date", "Document_No", "Description", "Amount", "Global_Dimension_1_Code", "Global_Dimension_2_Code", "User_ID", "Gen_Posting_Type", "CompanyId"})
Any ideas? Also where the hell is the preview post button?
Posted Dec 5, 2018, 10:50 AM UTC
Have you tried using the native connector or the common app connector to see if they are any faster?
For odata the syntax is $select=columnname
https://docs.microsoft.com/en-us/previous-versions/dynamicscrm-2015/developers-guide/gg309461(v=crm.7)#BKMK_filter
This guide is for dynamics but I imagine it works the same way.
For dynamics I haven't been able to get it to work with the version 9.1 API but it works fine with the 8.2 version.
Also it behaves a bit strangely with dynamics, in that it still pulls in all of the columns, but the values are just listed as null. It is significantly faster though, especially if you have lots of columns.
edit: mistake in syntax
Thanks, gotta test this once I get back to office on Monday.