Forum Discussion

ThomasRichard's avatar
2 years ago
Solved

Import CSV or Folder: Missing columns due to "special" first rows

Hi everyone,

 

I have troubles at the very first step of a project.

My CSV file looks like this:

9 rows with data in 2 columns (general infos), then all the other rows with many columns (500+), which is the data I want to work with, with a proper header, etc.

 

On my laptop, no problem, I can import CSV, and I just edit the query to delete the first 9 rows, promote headers, etc.

 

However, on my colleague's laptop, Power Bi only imports 2 columns, probably seeing the first rows and taking it as an example for the rest of the table. I guess the correction must be made before even editing query, but any idea of what we shouold do to get the full table?

Obviously I don't want to make any modifications on the csv file, the goal being to add a new file in the folder every day.

Thanks a lot in advance!

 

Kindly

 

Thomas

  • Hello,

     

    v-weiyan1-msft  and lbendlin  thank you for your suggestions, I found a solution.


    1st, it turned out the file my colleague was using was different and had the same effect on my PowerBi, which excluded a problem of Power Bi version. I didn't understand what was different as the structure of the first rows looked exactly the same when looking at the csv text.

     

    I could resolve it by going on Edit Query -> Transform Sample File -> Advanced Editor, and there change the number of columns in the code. 

     

     I am stuck at another step but will open a new topic for it.

     

    Thank you!

3 Replies

  • Take your Power Query code and send it to your colleague. They should be able to paste it into a blank query and take it from there.

     

    I sure hope you are unpivoting your 500+ columns ?

  • v-weiyan1-msft's avatar
    v-weiyan1-msft
    Icon for Community Support rankCommunity Support

    Hi ThomasRichard ,

     

    Based on your description, the csv file will be processed on your computer without issue. Different versions of Power BI may have different import restrictions. Please make sure that your coworkers have the same version of Power BI Desktop as yours and see if it fixes your problem.

     

    Best Regards,
    Yulia Yan

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Hello,

     

    v-weiyan1-msft  and lbendlin  thank you for your suggestions, I found a solution.


    1st, it turned out the file my colleague was using was different and had the same effect on my PowerBi, which excluded a problem of Power Bi version. I didn't understand what was different as the structure of the first rows looked exactly the same when looking at the csv text.

     

    I could resolve it by going on Edit Query -> Transform Sample File -> Advanced Editor, and there change the number of columns in the code. 

     

     I am stuck at another step but will open a new topic for it.

     

    Thank you!