Forum Discussion
data layer for re-usability, data source template
Anonymous you can surely combine multiple csv files wtih different column names. after file is read, your next step should be select columns a/b/c/d and it is automatically going to remove other columns regardless what those columns are
here are few posts on how you can combines files:
https://powerpivotpro.com/2016/12/import-csv-files-folder-filenames-power-bi/
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡
- Anonymous6 years agoNot applicable
thanks for your comment.
i tried using both methods but i am not able to create a template based approach.
whenever i try another data export with a set of new columns.. the structure is thrown off and i get junk data in reports
See the query below, is there a way to tell power bi that the number of columns can be variable or dynamic however we only want to pick first 4 columns and ignore the others.. i tried the choose columns approach and there is bug in it!... i am gettinn wrong data in my base 4 columns
= (Parameter1) => let
Source = Csv.Document(Parameter1,[Delimiter=",Encoding=1252, Columns=4, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true])
in
#"Promoted Headers"