Forum Discussion
Salesforce Lead Object Issue
- 9 years ago
Ok, so it turns out there is an actual bug here. Anonymous hopefully you can create a ticket from this (I'm assuming you're MS given your username?).
For the benefit of the wider interwebs here's the bug, and work-around.
Recreation:
Datasource: SFDC Objects
Object: Anything with a datetime, date only can also be problematic in similar ways.
Transform: Date->Month (month number, fails for both add column or transform. others like year number fail too).
Boom: DataSource.Error: Non-grouped query that uses overall aggregate functions cannot also use LIMIT
This used to only be a problem on larger tables like Leads - hence the above post. Since at least 22/5/2017 this seems to affect even tiny tables with only a few rows. TRied with April both and May PBI Desktop releases. Something seems to have changed on SFDC side as both PBI releases gave same result but for smaller tables this DEFINITELY worked in April release, and pretty sure May too - as said, larger tables were always an issue but the below workaround works on even my largest tables.
Example broken query:
let
Source = Salesforce.Data(),
ForecastingQuota = Source{[Name="ForecastingQuota"]}[Data],
#"Extracted Month" = Table.TransformColumns(ForecastingQuota,{{"StartDate", Date.Month}})
in
#"Extracted Month"Workaround:
If you have a date only field, just add a new column that extracts the "date only", basically you end up with a duplicate column but you can then successfully extract the month successfully.
Working query:
let
Source = Salesforce.Data(),
ForecastingQuota = Source{[Name="ForecastingQuota"]}[Data],
#"Inserted Date" = Table.AddColumn(ForecastingQuota, "Date", each DateTime.Date([StartDate]), type date),
#"Inserted Month" = Table.AddColumn(#"Inserted Date", "Month", each Date.Month([Date]), type number)
in
#"Inserted Month"Hope that helps save somebody else 5 hours of debugging a heavily nested set of reports...
Quick update: if you have multiple columns you don't seem to need to make duplicates of them all - as soon as one column is "fixed" the Transform/Add column works for others.
Hi hoshy were you able to find a solution? As a workaround, maybe you can try to test your connection with a 3rd party connector, which pulls data directly from the SF objects API and does not even have the 2k rows limitation, also this one shouldn't give you this problem you were facing. I've tried windsor.ai, supermetrics and funnel.io. I stayed with windsor because it is much cheaper so just to let you know other options. In case you wonder, to make the connection first search for the Salesforce connector in the data sources list:
After that, just grant access to your Salesforce account using your credentials, then on preview and destination page you will see a preview of your Salesforce fields:
There just select the fields you need. It is also compatible with custom fields and custom objects, so you'll be able to export them through windsor. Finally, just select PBI as your data destination and finally just copy and paste the url on PBI --> Get Data --> Web --> Paste the url.