Forum Discussion
OneDrive CSV without Headers loaded into PowerBI Service?
- Anonymous7 years ago
Indeed, but Power Query isn't available when connecting directly to OneDrive files in the Service.
I've found a workaround by using the SharePoint link from a OneDrive file when opened in Excel, used that in Power BI Desktop and utilised Power Query there, then published to the Service and setup a scheduled refresh. It feels like a bit of a hack but it works.
I solved this case in my own way:
1. I have created a file data_h.csv which contains column headers for the actual data file without headers: e.g. (id, header_1, header_2 etc.)
2. In Power BI - Power Query, add a query: from the txt/csv file (data_h.csv) (if present, remove the step: promote 1st row as headers)
3. add the 2nd query: from the txt/csv file - data file without header - (data.csv)
3. Add a query as a new one - combine rows from 2 tables as new ones: (1st: data_h.csv + 2nd: data.csv)
4. Use the 1st line as headings