Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I have begun including multiple custom visuals in my report, and the report is taking significant performance hits. Power BI crashes frequently and the pages are taking forever to load/render/interact. I have many more custom visuals that I intend to create and include in my report in the future. I was wondering if anyone has found any ways to alleviate this or work around performance hits with Power BI custom visuals:
Solved! Go to Solution.
Hi @Anonymous,
There are a couple of major possibilities here:
If you've ruled these out then it will be a case of profiling parts of your code to determine if they are perhaps not performing as well as they might be able to. I have found this very useful to understand how many times a function is being called, as well as how long it may take to execute and have previously made successful optimisations to the way I map data from the dataView into my view model using this method.
You can also use the performance analyzer within Power BI Desktop to rule out something like the incoming DAX query being the problem. If the DAX query takes a long time then this is nothing to do with the visual as their code doesn't execute until the main Power BI window supplies it with the dataView.
Another technique is checking options.type in the update method. You don't need to map your view model data every time the visual updates (e.g. if resizing), only when new data is supplied. Here's an example of how I handle this in one of my visuals.
If you've ruled out the above, it's probably worth having a further look at your visual code. If you're able to share a repository or similar location then it might be possible to take a look and see if there's anything obvious.
Anyway, I hope this gives you some ideas for your investigations.
Regards,
Daniel
Proud to be a Super User!
My course: Introduction to Developing Power BI Visuals
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Hi @Anonymous,
There are a couple of major possibilities here:
If you've ruled these out then it will be a case of profiling parts of your code to determine if they are perhaps not performing as well as they might be able to. I have found this very useful to understand how many times a function is being called, as well as how long it may take to execute and have previously made successful optimisations to the way I map data from the dataView into my view model using this method.
You can also use the performance analyzer within Power BI Desktop to rule out something like the incoming DAX query being the problem. If the DAX query takes a long time then this is nothing to do with the visual as their code doesn't execute until the main Power BI window supplies it with the dataView.
Another technique is checking options.type in the update method. You don't need to map your view model data every time the visual updates (e.g. if resizing), only when new data is supplied. Here's an example of how I handle this in one of my visuals.
If you've ruled out the above, it's probably worth having a further look at your visual code. If you're able to share a repository or similar location then it might be possible to take a look and see if there's anything obvious.
Anyway, I hope this gives you some ideas for your investigations.
Regards,
Daniel
Proud to be a Super User!
My course: Introduction to Developing Power BI Visuals
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)
Thanks so much! I apologize for the delayed response. I was able to use your suggestions to significantly improve my custom visual. Your in-depth guidelines really made a significant difference. I think updating the SDK and finding some redundancies in the code did the trick!
Proud to be a Super User!
My course: Introduction to Developing Power BI Visuals
On how to ask a technical question, if you really want an answer (courtesy of SQLBI)