Forum Discussion

ChrisWilliams's avatar
ChrisWilliams
Advocate II
1 year ago
Solved

Custom Sorting with multiple visuals on the page causes an error

I've implemented custom sorting in a custom Power BI visual I've created.   It all works fine when there is one visual only on the page.  However, if I have more than one visual on the page, I get ...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi, ChrisWilliams 

     

    In response to your query, my initial thought revolves around the issue of custom visual object interactions. You might consider manually editing these interactions to ensure there are no unintended interactions between the visuals.

    For further details, please refer to:

    Change how visuals interact in a report - Power BI | Microsoft Learn

    ...
       let allowInteractions = options.host.hostCapabilities.allowInteractions;
       bars.on('click', function(d) {
           if (allowInteractions) {
               selectionManager.select(d.selectionId);
               ...
           }
       });

    For further details, please refer to:
    https://learn.microsoft.com/en-us/power-bi/developer/visuals/visuals-interactions#set-interactive-permissions

     

    Regarding the definitions of sortDirectionA and sortDirectionB, I currently do not see their definitions directly. Additionally, since you have implemented an external loop that repeatedly executes this operation, I recommend checking your visual object's configuration file to confirm the definitions and default values for sortDirectionA and sortDirectionB.

     

    Lastly, here is the documentation for diagnosing exceptions, which I hope will be helpful to you:

    Debug Power BI custom visuals - Power BI | Microsoft Learn

    Of course, if you have any new discoveries or questions, please feel free to get in touch with us.
     

    Best Regards,

    Leroy Lu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.