Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
TheMoM
Regular Visitor

Filter function Power BI

Hello everyone, I have a problem in my filter function that is stopping the process, it's simply the targetpages.getvisuals() that is not recognized as a function, i searched everywhere on the net .getvisuals() is what is used from the javascript API of power BI. Anyone can help me please solve this problem? Here's the code below :

Capture d’écran 2024-07-03 170458.png

2 REPLIES 2
Anonymous
Not applicable

Hi  @TheMoM ,

 

You can try checking that before calling getvisuals(), you need to define a variable to receive a specific page before calling its subfunction.

You may refer to the code as below and I hope it could help you to resolve your issue.

report.getPages()
  .then(function (pages) {
    // Retrieve first page.
    var firstPage = pages[0];
    firstPage.getVisuals()
      .then(function (visuals) {
        console.log(visuals);
      })
  })

 

Best Regards,

Liu Yang

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

Yes that's what I did with :

const targetPage = pages[0];

Am I misunderstanding something?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.