Power Query(M) 示例

let
    Source = Folder.Files("\\jsds1.live\dfs\Userprofiles\ixh500\UPM_Profile\desktop\PQ Desktop Demos\Set 2"),
    #"Lowercased Text" = Table.TransformColumns(Source,{{"Extension", Text.Lower}}),
    #"Filtered Rows" = Table.SelectRows(#"Lowercased Text", each ([Extension] = ".csv")),
    #"Combined Binaries" = Binary.Combine(#"Filtered Rows"[Content]),
    #"Imported CSV" = Csv.Document(#"Combined Binaries",[Delimiter=",", Columns=4, Encoding=1252, QuoteStyle=QuoteStyle.None]),
    #"Promoted Headers" = Table.PromoteHeaders(#"Imported CSV"),
    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"TranDate", type date}, {"Account", Int64.Type}, {"Dept", Int64.Type}, {"Sum of Amount", type number}})
in
    #"Changed Type"

(開啟資料夾中的所有檔案,過濾 CSV 檔案,開啟並組合所有 CSV 檔案並設定列資料型別。請注意,這些程式碼都不是手動輸入的,而是通過單擊 Power Query Editor 中的圖示生成的。)