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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Connect Github CVS to BI

How can i connect tis url 
csse_covid_19_data/csse_covid_19_time_series/time_series_covid19_recovered_global.csv
to power bi and transform it as a table
Capture.PNG

1 ACCEPTED SOLUTION
AllisonKennedy
Super User
Super User

You need to provide the whole URL. Try this M code as a starting point:

let
Source = Web.Page(Web.Contents("https://github.com/CSSEGISandData/COVID-19/blob/master/csse_covid_19_data/csse_covid_19_time_series/...")),
Data = Source{0}[Data],
#"Removed Columns" = Table.RemoveColumns(Data,{""}),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Removed Columns", { "Province/State", "Country/Region", "Lat", "Long"}, "Report Date", "Cases"),
#"Added Custom" = Table.AddColumn(#"Unpivoted Other Columns", "Status", each "Recovered")
in
#"Added Custom"

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

View solution in original post

3 REPLIES 3
AllisonKennedy
Super User
Super User

You need to provide the whole URL. Try this M code as a starting point:

let
Source = Web.Page(Web.Contents("https://github.com/CSSEGISandData/COVID-19/blob/master/csse_covid_19_data/csse_covid_19_time_series/...")),
Data = Source{0}[Data],
#"Removed Columns" = Table.RemoveColumns(Data,{""}),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Removed Columns", { "Province/State", "Country/Region", "Lat", "Long"}, "Report Date", "Cases"),
#"Added Custom" = Table.AddColumn(#"Unpivoted Other Columns", "Status", each "Recovered")
in
#"Added Custom"

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Anonymous
Not applicable

You can generate a blank query and paste this code.

let
    Source = Csv.Document(File.Contents("pastyourURL.csv"),[Delimiter=",", Columns=7, Encoding=65001, QuoteStyle=QuoteStyle.None]),
    #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
  
in
 #"Promoted Headers"

If you import any CSV file, you can find the M code generated by the import and reuse it with its URL

My_PowerBI_Blog

amitchandak
Super User
Super User

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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