If you want to extract data from Sharepoint online using Power BI then this code snippet might help to connect to Sharepoint online
Code Snippet as below:
let
 Source = SharePoint.Files(“https://XYZ.sharepoint.com/”, [ApiVersion = 15]),
 #”Sprint Backlog.xlsx_https://XYZ.sharepoint.com/Reporting Forms/” = Source{[Name=”Sprint Backlog.xlsx”,#”Folder Path”=”https://XYZ.sharepoint.com/Reporting Forms/”]}[Content],
 #”Imported Excel” = Excel.Workbook(#”Sprint Backlog.xlsx_https://XYZ.sharepoint.com/Reporting Forms/”)
in
 #”Imported Excel”