Forum Discussion

sahilpruthi's avatar
sahilpruthi
Helper I
9 years ago
Solved

How to move your local Datasource (.csv) to Azure Data Lake

How to move your local Datasource (.csv) to Azure Data Lake such that we can use already created .pbix file.

  • sahilpruthi's avatar
    sahilpruthi
    9 years ago

    Thanks Herbert

     

    One more thing I want to confirm is the transformation I have applied to data in .pbix needs to be done again?

10 Replies

  • v-haibl-msft's avatar
    v-haibl-msft
    Microsoft Employee

    sahilpruthi

     

    If the source of already created .pbix file is .csv file in your local computer, after you upload this .csv file to Azure Data Lake, you can go to Power BI Query Editor and change the power query in Advance Editor. We just need to change the source query as below.

     

    let
        Source = DataLake.Contents("adl://herbert.azuredatalakestore.net"),
        #"How to move your local Datasource ( csv) to Azure Data Lake csv" = Source{[Name="How to move your local Datasource (.csv) to Azure Data Lake.csv"]}[Content],
        #"Imported CSV" = Csv.Document(#"How to move your local Datasource ( csv) to Azure Data Lake csv",[Delimiter=",", Columns=2, Encoding=65001, QuoteStyle=QuoteStyle.None]),
        #"Promoted Headers" = Table.PromoteHeaders(#"Imported CSV"),
        #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Date", type date}, {"Sales", Int64.Type}})
    in
        #"Changed Type"
    let
        Source = Csv.Document(File.Contents("C:\How to move your local Datasource (.csv) to Azure Data Lake.csv"),[Delimiter=",", Columns=2, Encoding=65001, QuoteStyle=QuoteStyle.None]),
        #"Promoted Headers" = Table.PromoteHeaders(Source),
        #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Date", type date}, {"Sales", Int64.Type}})
    in
        #"Changed Type"

     

    Best Regards,

    Herbert

    • sahilpruthi's avatar
      sahilpruthi
      Helper I

      Thanks Herbert

       

      One more thing I want to confirm is the transformation I have applied to data in .pbix needs to be done again?

      • v-haibl-msft's avatar
        v-haibl-msft
        Microsoft Employee

        sahilpruthi

         

        No, you only need to update the source lines which marked as yellow, and keep the remaining transformation lines.

         

        Best Regards,

        Herbert