Forum Discussion
EC305
1 year agoNew Member
Handling Missing Columns in Combined Files to Maintain Header Alignment
When combining six files for example, sometimes one or a few of the files will have one column (titled "YYY") with no data which causes the column to not report in that file and headers to shift. Exa...
- 1 year ago
In Power BI, you can use Power Query to handle this issue:
- Load Data: Load your combined file into Power Query.
- Identify Misalignment:
- Add a conditional column: = if Text.EndsWith([Col. A], "1.txt") and [Col. M] <> "YYY" then true else false.
- Shift Columns:
- Duplicate your table.
- Shift columns M-W for misaligned rows using a custom column and transformation logic.
- Combine Data:
- Append the corrected table back to the original, ensuring all rows align.
v-veshwara-msft
Community Support
1 year agoHi EC305 ,
Just wanted to check if the query has been resolved at your end or if any of the solutions provided met your requirements. If so, please mark the helpful reply as the solution to help others in the community with similar queries.
If further assistance is needed, please reach out.
Thank you.