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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

Reply
LijunChen
Resolver I
Resolver I

Best Methods of Importing Data Into Power BI: Text/CSV vs Web?

Hi Friends,

 

I have a question about the best method to use to import Text/CSV files into Power BI. I have Power BI pro license. Power BI desktop has both Text/CSV and Web options to import data. The data files I am using are txt files stored in Sharepoint on Line (accessible to other remote-working members of our company). See screenshot below:  

LijunChen_0-1727995083326.png

I can use both methods to import the data into power BI. The first method fecthes the data in my c: drive and the 2nd method get the data from the web address. But it is the same data file (the file in project folder in my computer is synced with the Sharepoint on line file. See the source code in Power Query editor below: 

= Csv.Document(File.Contents("C:\Users\lchen\BIIT - Documents\General\Templates and Tools\............)

=Csv.Document(Web.Contents("https://sligov.sharepoint.com/sites/BIIT/Shared%20Documents/General/Templates%20and%20Tools/.........)

 

My coworkers who read the dashboard report I created with either method have no issues accessing them. So I wonder what is advantage and disadvantage of the 2 methods?

 

1 ACCEPTED SOLUTION
Kedar_Pande
Memorable Member
Memorable Member

@LijunChen ,

Using File.Contents fetches data from your local drive, which is good for personal use but won't be accessible to others if they need to refresh the dataset.
Using Web.Contents (SharePoint) is better for shared work. It ensures the data is always up-to-date and accessible by others without needing your local file, making it the recommended approach for collaboration.

 

If this helped, a Kudos 👍 or Solution mark would be great!
Cheers,
Kedar Pande
www.linkedin.com/in/kedar-pande

View solution in original post

6 REPLIES 6
Kedar_Pande
Memorable Member
Memorable Member

@LijunChen ,

Using File.Contents fetches data from your local drive, which is good for personal use but won't be accessible to others if they need to refresh the dataset.
Using Web.Contents (SharePoint) is better for shared work. It ensures the data is always up-to-date and accessible by others without needing your local file, making it the recommended approach for collaboration.

 

If this helped, a Kudos 👍 or Solution mark would be great!
Cheers,
Kedar Pande
www.linkedin.com/in/kedar-pande

Thanks @Kedar_Pande for your informative answer. 

If the report is fetching data in my local drive, it seems I cannot set up data auto-refresh for the data/model. Nor can another other member in the workspace.  

For that, you will need to set up a Power BI data Gateway.
https://learn.microsoft.com/en-us/power-bi/connect-data/service-gateway-onprem

v-bofeng-msft
Community Support
Community Support

Hi @LijunChen ,

 

Both methods retrieve data from CSV files, with the main difference being the file's storage location—one is local, and the other is in the cloud. From the perspective of report users, there is no noticeable difference. However, if there is a need to refresh the data in the future, the semantic model that retrieves data locally will still require a gateway to be installed locally.

 

Best Regards,

Bof

Thanks, @v-bofeng-msft . I do find that I cannot set up auto-refresh in the workspace with setting up a loca gateway connection, which I find challenging. Suppose I do get the local gateway up and running, does that mean my laptop needs to be always on and online, otherwise the data won't be refreshed?    

Hi @LijunChen ,

 

Yes.

 

Best Regards,

Bof

Helpful resources

Announcements
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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