Just writing this for my own posterity. Maybe its already a commonly known tidbit.
If you want to filter on datetime fields from D365FO OData services, from PowerBI, you have to do it in a specific way. What made it work for me was the following.
1 2 3 4 5 6 7 8 9 |
let PO_Lines = OData.Feed("https://afahrenholz-dev24d2d448f42b83303devaos.cloudax.dynamics.com/data/PurchaseOrderLinesV2?" & "$select=dataAreaId,PurchaseOrderNumber,LineAmount,PurchasePrice,ProjectId,ProjectCategoryId,ProcurementProductCategoryName,VendorInvoiceMatchingPolicy,RequestedDeliveryDate" & "&$cross-company=true" & "&$filter=RequestedDeliveryDate ge " & Date.ToText(Date.AddDays(Date.From(DateTime.FixedLocalNow()), -PeriodBackInTime), "yyyy-MM-dd") //& "&$filter=RequestedDeliveryDate ge 2021-01-01" , null, [Implementation="2.0"]) in PO_Lines |
Make sure to put the $filter
after the $select
, and make sure there are no line-breaks in the URL string
Cheers