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

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

Reply
anap1br
Frequent Visitor

Automatically export table from visual with Selenium

Hello! I'm trying to use Selenium in python to access a report in app.powerbi.com and export data from a table visual automatically.

The problem is I can't select anything in the report. The script manages to find the elements but doesn't interact with them. I've also tried to see if there's a different frame I need to switch to, but I couldn't find any.

When I'm doing it manually I click in '...' More Options and Export Data.

Has anyone managed to do this? I'm open to new solutions that don't include Selenium

2 REPLIES 2
simontaylor
Microsoft Employee
Microsoft Employee

I will try to use Python with Selenium to achive this goal. Let's see.

lbendlin
Super User
Super User

Are you on shared capacity or on Premium?

 

Power BI performance analyzer allows you to "borrow" the DAX query for each visual, and you can then run that query in your XMLA endpoint of choice (DAX studio, SSMS, etc)

lbendlin_0-1618186801687.png

Opening this in DAX Studio gives:

 

// DAX Query
DEFINE
  VAR __DS0Core = 
    SUMMARIZECOLUMNS(
      ROLLUPADDISSUBTOTAL(
        ROLLUPGROUP(
          'Vulnerabilities'[Plugin ID],
          'Vulnerabilities'[Open Date],
          'Vulnerabilities'[Host],
          'Vulnerabilities'[Repeated],
          'Vulnerabilities'[Status]
        ), "IsGrandTotalRowTotal"
      ),
      "SumCount", CALCULATE(SUM('Vulnerabilities'[Count]))
    )

  VAR __DS0PrimaryWindowed = 
    TOPN(
      502,
      __DS0Core,
      [IsGrandTotalRowTotal],
      0,
      'Vulnerabilities'[Open Date],
      1,
      'Vulnerabilities'[Plugin ID],
      1,
      'Vulnerabilities'[Host],
      1,
      'Vulnerabilities'[Repeated],
      1,
      'Vulnerabilities'[Status],
      1
    )

EVALUATE
  __DS0PrimaryWindowed

ORDER BY
  [IsGrandTotalRowTotal] DESC,
  'Vulnerabilities'[Open Date],
  'Vulnerabilities'[Plugin ID],
  'Vulnerabilities'[Host],
  'Vulnerabilities'[Repeated],
  'Vulnerabilities'[Status]

 

and executing it gives:

 

lbendlin_1-1618186916673.png

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Solution Authors