The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hello!
I have a Microsoft Fabric notebook in which I am pulling API data using python and saving it as a dataframe. I am new to Microsoft Fabric, so I don't have a lot of knowledge of all the inner workings. I would like to pull this data into power query to merge with other queries and for use in PBI, but I am struggling to find an effective method to do this.
Thanks!
Solved! Go to Solution.
To pull data from a Microsoft Fabric notebook into Power Query for use in Power BI, you can follow these steps:
Save Data from Notebook to a Storage Location:
Connect Power Query to the Storage Location:
Here’s a detailed guide to achieve this:
Save as CSV in Azure Blob Storage:
from azure.storage.blob import BlobServiceClient
import pandas as pd
# Your dataframe
df = pd.DataFrame(data)
# Save dataframe as CSV
csv_data = df.to_csv(index=False)
# Azure Blob Storage details
connection_string = "your_connection_string"
container_name = "your_container_name"
blob_name = "your_file_name.csv"
# Create the BlobServiceClient object
blob_service_client = BlobServiceClient.from_connection_string(connection_string)
blob_client = blob_service_client.get_blob_client(container=container_name, blob=blob_name)
# Upload the CSV data
blob_client.upload_blob(csv_data, overwrite=True)
Connect to Azure Blob Storage:
Connect to OneDrive or SharePoint:
Load and Transform Data in Power Query:
To pull data from a Microsoft Fabric notebook into Power Query for use in Power BI, you can follow these steps:
Save Data from Notebook to a Storage Location:
Connect Power Query to the Storage Location:
Here’s a detailed guide to achieve this:
Save as CSV in Azure Blob Storage:
from azure.storage.blob import BlobServiceClient
import pandas as pd
# Your dataframe
df = pd.DataFrame(data)
# Save dataframe as CSV
csv_data = df.to_csv(index=False)
# Azure Blob Storage details
connection_string = "your_connection_string"
container_name = "your_container_name"
blob_name = "your_file_name.csv"
# Create the BlobServiceClient object
blob_service_client = BlobServiceClient.from_connection_string(connection_string)
blob_client = blob_service_client.get_blob_client(container=container_name, blob=blob_name)
# Upload the CSV data
blob_client.upload_blob(csv_data, overwrite=True)
Connect to Azure Blob Storage:
Connect to OneDrive or SharePoint:
Load and Transform Data in Power Query:
User | Count |
---|---|
65 | |
60 | |
55 | |
54 | |
31 |
User | Count |
---|---|
180 | |
88 | |
70 | |
46 | |
46 |