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.
BA_Pete
1 year agoSuper User
Hi EC305 ,
Can you provide examples of actual source data please, one where the column is present, and one where it is not? Please also provide an example of what your desired outcome is based on these two new examples provided.
I think I understand the issue, but the question is a bit too vague to be sure.
For more info on how to provide good data for us to work with, please read through this:
Pete