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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
jch
Microsoft Employee
Microsoft Employee

Import SharePoint Spreadsheet Through Python Script in Power BI

Has anyone successfully written a Python Script run in Power Bi that replaces steps in Power Query to import a sharepoint spreadsheet?

jch_0-1631201893458.png

 

I've already tried 2 different scripts

 

 

# 'dataset' holds the input data for this script
import pandas as pd
#pd.read_excel('https://orgname.sharepoint.com/teams/MyTeam/Shared Documents/General/Security/Metrics/myspreadsheet.xlsx', sheet_name=[8]) # load ws6

 

 

and 

 

 

# 'dataset' holds the input data for this script
import pandas as pd

# load example
df1 = pd.read_excel('https://orgname.sharepoint.com/teams/MyTeam/Shared Documents/General/Security/Metrics/myspreadsheet.xlsx',
# get sheets 2 through 8; rows 1-2 are the headers
sheet_name=[2, 3, 4, 5, 6, 7, 8], header=[1, 2])

 

 

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

1 REPLY 1
lbendlin
Super User
Super User

Looks like you need to download the file before you can open it

How to read SharePoint Online (Office365) Excel files into Python specifically pandas with Work or S...

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

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.