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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Laila92
Helper V
Helper V

Connect Powerbi to Github

I am trying to load a github repo into powerbi ( https://github.com/Laila92/COVID-19/tree/master/csse_covid_19_data)
I followed this tutorial (https://thinkaboutit.be/2018/03/connect-to-github-microsoft-al-with-power-bi/) ,  and am able to connect to the Github repo but not seeing the actual data. Instead i see like how many people contributed.
How do I load the actual data into Powerbi?

1 ACCEPTED SOLUTION
v-lid-msft
Community Support
Community Support

Hi @Laila92 ,

 

We can create a blank query and use following query in Advanced Editor to meet your requirement:

 

let
    Source = List.Dates(#date(2020,1,22),Duration.Days(DateTime.Date(DateTime.LocalNow())-#date(2020,1,22)),#duration(1,0,0,0)),
    #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Added Custom" = Table.AddColumn(#"Converted to Table", "Custom", each Date.ToText([Column1],"MM-dd-yyyy")),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "Custom.1", each Table.PromoteHeaders(Csv.Document(Web.Contents("https://raw.githubusercontent.com",[RelativePath="/Laila92/COVID-19/master/csse_covid_19_data/csse_covid_19_daily_reports/"&[Custom]&".csv"]),[Delimiter=",", Columns=6, Encoding=65001, QuoteStyle=QuoteStyle.None]),[PromoteAllScalars=true])),
    #"Removed Errors" = Table.RemoveRowsWithErrors(#"Added Custom1", {"Custom.1"}),
    #"Expanded Custom.1" = Table.ExpandTableColumn(#"Removed Errors", "Custom.1", {"Province/State", "Country/Region", "Last Update", "Confirmed", "Deaths", "Recovered"}, {"Province/State", "Country/Region", "Last Update", "Confirmed", "Deaths", "Recovered"})
in
    #"Expanded Custom.1"

 

6.jpg

 

Please also refer to this similar thread:  https://community.powerbi.com/t5/Desktop/Get-data-from-web-cannot-bring-the-table/td-p/974083


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-lid-msft
Community Support
Community Support

Hi @Laila92 ,

 

We can create a blank query and use following query in Advanced Editor to meet your requirement:

 

let
    Source = List.Dates(#date(2020,1,22),Duration.Days(DateTime.Date(DateTime.LocalNow())-#date(2020,1,22)),#duration(1,0,0,0)),
    #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Added Custom" = Table.AddColumn(#"Converted to Table", "Custom", each Date.ToText([Column1],"MM-dd-yyyy")),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "Custom.1", each Table.PromoteHeaders(Csv.Document(Web.Contents("https://raw.githubusercontent.com",[RelativePath="/Laila92/COVID-19/master/csse_covid_19_data/csse_covid_19_daily_reports/"&[Custom]&".csv"]),[Delimiter=",", Columns=6, Encoding=65001, QuoteStyle=QuoteStyle.None]),[PromoteAllScalars=true])),
    #"Removed Errors" = Table.RemoveRowsWithErrors(#"Added Custom1", {"Custom.1"}),
    #"Expanded Custom.1" = Table.ExpandTableColumn(#"Removed Errors", "Custom.1", {"Province/State", "Country/Region", "Last Update", "Confirmed", "Deaths", "Recovered"}, {"Province/State", "Country/Region", "Last Update", "Confirmed", "Deaths", "Recovered"})
in
    #"Expanded Custom.1"

 

6.jpg

 

Please also refer to this similar thread:  https://community.powerbi.com/t5/Desktop/Get-data-from-web-cannot-bring-the-table/td-p/974083


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

That is a great solution!  However, it's only pulling data from 1/22/2020 - 3/18/2020. 

 

So, I've changed the Relative Path in your code to go directly to the Johns Hopkins github:

 

let
Source = List.Dates(#date(2020,1,22),Duration.Days(DateTime.Date(DateTime.LocalNow())-#date(2020,1,22)),#duration(1,0,0,0)),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Added Custom" = Table.AddColumn(#"Converted to Table", "Custom", each Date.ToText([Column1],"MM-dd-yyyy")),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Custom.1", each Table.PromoteHeaders(Csv.Document(Web.Contents("https://raw.githubusercontent.com",[RelativePath="/CSSEGISandData/COVID-19/tree/master/csse_covid_19_data/csse_covid_19_daily_reports/"&[Custom]&".csv"]),[Delimiter=",", Columns=6, Encoding=65001, QuoteStyle=QuoteStyle.None]),[PromoteAllScalars=true])),
#"Removed Errors" = Table.RemoveRowsWithErrors(#"Added Custom1", {"Custom.1"}),
#"Expanded Custom.1" = Table.ExpandTableColumn(#"Removed Errors", "Custom.1", {"Province/State", "Country/Region", "Last Update", "Confirmed", "Deaths", "Recovered"}, {"Province/State", "Country/Region", "Last Update", "Confirmed", "Deaths", "Recovered"})
in
#"Expanded Custom.1"

 

But there is some problem. After I load the data into Advanced Editor, here is the outcome. No data:

Screenshot 2020-11-11 000730.png

 

I would appreciate any help!  Thank you.

 

-Stephen

amitchandak
Super User
Super User

Refer, if this can help

https://docs.microsoft.com/en-us/power-bi/service-connect-to-github

https://github.com/microsoft/PowerBI-Developer-Samples

https://github.com/Microsoft/PowerBI-visuals

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.