Forum Discussion

BiBra's avatar
BiBra
Helper III
8 years ago

change datasource containing more or less columns

Hello

 

I have a report. This report is supposed to be a "super" report. This meaning it contains a set of graphs applicable to different data sources. The names included are the same, so no problem there. However, the other datasets may contain extra or fewer columns. 

I tried in query editor, where I change the source of each table. But this is where I get a fault. Is there any way to do this flaw free?

 

5 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Go into the advanced editor. You should see a line at the start that specifies the source of your data. In this line should be an argument specifying how many columns your data source has. Simply update this number to reflect the number of columns in your new dataset.

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

    Hi BiBra,

     

    Based on my test, to switch to a data source containing more columns than current one, you can directly change the connection string in Power Query code as highlighted in below screenshot.

     

    However, it is not supported to directly change to a data source with less columns. You might get below error.

     

    Best regards,

    Yuliana Gu

    • BiBra's avatar
      BiBra
      Helper III

      v-yulgu-msft Thank you for your answer, however, your solution of dataset change is the same as the solution as I posted myself. 

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi All

    And does anyone know how to fis the issue when data source containes less columns?

     

  • matovua's avatar
    matovua
    Frequent Visitor

    go to edit queries, select table, advanced editor, change columns=nn, modify the column definition

     

    , Columns=6, Encoding=1252, QuoteStyle=QuoteStyle.None] to , Columns=7, Encoding=1252, QuoteStyle=QuoteStyle.None]

     

    Add for example {"momo_rgs_90", type text}

     

    Anthony