Forum Discussion

B-FHY's avatar
B-FHY
New Member
1 year ago
Solved

Retrieving data from CSV, not showing the correct columns

So I am connecting a CSV in a SharePoint to PowerBI. I use, Get Data - SharePoint Folder and then link my Sharepoint. Because there are so many excel and CSV files in my Sharepoint, my CSV doesn't in...
  • v-karpurapud's avatar
    1 year ago

    Hi B-FHY 

     

    Thank you for reaching out to the Microsoft Fabric Community Forum. We understand you're experiencing an issue with retrieving data from a CSV when connecting to a SharePoint folder. Let's go through the troubleshooting steps:

     

    When combining files, power query automatically selects a sample file (usually the first file in the SharePoint directory). If this sample file differs from your actual CSV, it may have different columns, causing discrepancies.

     

    The "Changed Type" step applies column transformations based on the structure detected in the sample file. If the actual CSV has different columns, power query will throw a "Column Not Found" error because it tries to apply transformations to non-existent columns.

     

    1. Check the Sample File

    • In Power Query Editor, expand "Transform Sample File".
    • Ensure Power Query is using the correct CSV file as the sample.

     

    2. Fix the "Changed Type" Step

    • In Query Settings, in the "Changed Type" step, remove references to missing columns (e.g., "Work Order Closed Status Modified Date").
    • Re-add missing columns manually, if needed.

     

    3. Ensure the CSV Updates Correctly

    • If the CSV changes over time, replace "Changed Type" with promoted headers.
    • Check if a "Removed Other Columns" step exists—edit it to keep all necessary columns.

     

    4. Apply Changes & Refresh

    • Apply changes and refresh the data.
    • If the issue persists, delete and re-import the CSV using the correct sample file.

     

    If my response has resolved your query, please mark it as the Accepted Solution to help others. Additionally, I would appreciate a 'Kudos' if you found my response helpful. 

     

    Thank you!