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.
Hi All
I have load 4 CSV file to sharepoint folder. The script as below :-
let
Source = SharePoint.Files("https://isdnholdings.sharepoint.com/sites/FTGL/", [ApiVersion = 15]),
#"Filtered Hidden Files1" = Table.SelectRows(Source, each [Attributes]?[Hidden]? <> true),
#"Invoke Custom Function1" = Table.AddColumn(#"Filtered Hidden Files1", "Transform File", each #"Transform File"([Content])),
#"Renamed Columns1" = Table.RenameColumns(#"Invoke Custom Function1", {"Name", "Source.Name"}),
#"Removed Other Columns1" = Table.SelectColumns(#"Renamed Columns1", {"Source.Name", "Transform File"}),
#"Expanded Table Column1" = Table.ExpandTableColumn(#"Removed Other Columns1", "Transform File", Table.ColumnNames(#"Transform File"(#"Sample File"))),
#"Changed Type" = Table.TransformColumnTypes(#"Expanded Table Column1",{{"Source.Name", type text}, {"GL Code", Int64.Type}, {"GL Description", type text}, {"Type", type text}, {"Month", Int64.Type}, {"Year", Int64.Type}, {"Posting Date", type date}, {"AccCur", type any}, {"AccConvRate", Int64.Type}, {"C/D", type number}, {"CurrencyValue", Int64.Type}, {"Reporting Code", Int64.Type}, {"Date", type date}})
in
#"Changed Type"
My question is , how to modify the above script , so that it will only load 1 CSV file instead now load 4 CSV file.
The reasons is , i try to create sample PBI file , so that it can load faster , until i tested okay , then i load all raw data file. My actual raw data file have more then 100.
Paul Yeo
Solved! Go to Solution.
You have 2 ways to do this
1st Way- Re import your Folder from Sharepoint and do not click on "Combine" data since you only need 1 table ,
you will get this in Power Query
Click on Binary of the File you want to keep and then Table
you will be set
2nd way is: since you already combined the 4 files then go to this step
Click on Binary and then Table (Like i explained on the 1st way) , then click on "Continue"and you will be all set.
Regards
Amine Jerbi
If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook
You can insert a step after #"Filter Hidden Files1" to select just the top row or modify the code to add.
#"Filtered Hidden Files1" = Table.SelectRows(Source, each [Attributes]?[Hidden]? <> true){0},
This returns the index 0 (first) row of the table.
Thank you and happy new year to you.
After i insert {0}
I get error msg :-
I unable to clear the error.
Paul
Hi @admin11
Delete these steps and re do them again if you need them.
Regards
Amine Jerbi
If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook
You have 2 ways to do this
1st Way- Re import your Folder from Sharepoint and do not click on "Combine" data since you only need 1 table ,
you will get this in Power Query
Click on Binary of the File you want to keep and then Table
you will be set
2nd way is: since you already combined the 4 files then go to this step
Click on Binary and then Table (Like i explained on the 1st way) , then click on "Continue"and you will be all set.
Regards
Amine Jerbi
If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
98 | |
97 | |
81 | |
77 | |
66 |
User | Count |
---|---|
126 | |
105 | |
103 | |
81 | |
72 |