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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
sp_mike
Helper II
Helper II

Python add data to existing table based on existing data

I have data imported in power bi. I want to use one of the columns as input to fetch data from the internet. The data I receive I want to add to anonther (existing table). Something like this:

 

import pandas as pd

df = dataset #Required step in Power BI

gb_list = df['Column2'].T.tolist()
gb_list = list(dict.fromkeys(gb_list))

---Get data from internet ----

---Write result to other table----

df2 = second table
second table.column1 = bla, 
second table.colum2 = blabla
etc
etc

 

 

Can this be done, using Python?

1 ACCEPTED SOLUTION

Hi, @sp_mike 

 

Could you consider turning off both options in power query?

vjaneygmsft_0-1643700017424.png

And try not to add data sources that you don't want to refresh after publishing to the service.

 

Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.

Best Regards,
Community Support Team _ Janey

View solution in original post

7 REPLIES 7
sp_mike
Helper II
Helper II

Ok, indeed. Thanks.

However, I use data from an already existing dataset as variable for my second web query. How can I fetch the data from this first dataset. Sy this would be a table called "test"

 

I would like to do something like : 

df = test # my already existing table
gb_list = df['Column2'].T.tolist()

 

How can I do that?

CNENFRNL
Community Champion
Community Champion

AFAIK, you can't use py to read datasets existing in PBI because they are not stored as separate files.

 

PQ itself is a powerful ETL tool; I don't see the point resorting to a third-party script to manipulate dataset already existing within PQ.

gb_list = test['Column2']

Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

What I try to do is scrape a webpage with a lot of data and each time I start PBI I want to add the latest records and not load the everything again because this would take ages. Besides the initial data comes from one webpage and the added data from another. I hope this makes sense.

Hi, @sp_mike 

 

Could you consider turning off both options in power query?

vjaneygmsft_0-1643700017424.png

And try not to add data sources that you don't want to refresh after publishing to the service.

 

Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.

Best Regards,
Community Support Team _ Janey

It was getting a bit complicated to collect all data directly in powerBI. For now I collect the main part in mySQL (using python scipt) and use mySQL as source in PowerBI

Thanks, I was not aware of these settings.

CNENFRNL
Community Champion
Community Champion

CNENFRNL_0-1643213201991.png

 


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.