Because we have 30-40 KPI items in the page (displayed through expand/collapse feature or modal, but all in DOM), the selectValues method can take a while, somehow freezing the page while working on, during a few seconds.
My question is then :
Is there a way to have a callback on this method ? I mean in order to know when is has finished filtering and updating all KPIs in client's browser.
This way i could display a loading overlay and remove it when done.
Normally the selectValues call is very fast. That's because the calculations aren't done yet. Instead what you get back from the selectValues call would be an array with handles to all objects that are affected. If you use the browser console to watch the traffic on the web socket you would see this ( also if use use the Engine API explorer in dev-hub). So even though the selectValues call returns a promise, waiting for that won't help.
What normally takes time is the getLayout call(s) made after that, that's when the calculation happens. You really need to wait until all those are ready. I don't know of any case where this has been done but it should be possible, though there isn't really any support for that in the APIs.