Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

How to not recreate Pivot Tables and Dax formulas in Excel when the data table is changed

Dear all,   Situation: I created a Dashboard in Excel using Pivot Tables and Dax Formulas and I linked it to a folder, which contains SQL csv table files (from my SQL queries) using PowerQuery.   ...
  • KNP's avatar
    4 years ago

    I'm not sure I'm clear on the problem. Why would you need to recreate because of new columns?

    For your current setup, if you have a line in your Power Query that looks something like...

      Source = Csv.Document(
        File.Contents("yourDirectory\yourFile.csv"), 
        [Delimiter = ",", Columns = 4, Encoding = 1252, QuoteStyle = QuoteStyle.None]

     

    remove the part that says "Columns = x," and it will bring through all columns in the file even when new ones are added. 

    New...

      Source = Csv.Document(
        File.Contents("yourDirectory\yourFile.csv"), 
        [Delimiter = ",", Encoding = 1252, QuoteStyle = QuoteStyle.None]

    Hope this helps.