Forum Discussion
Changing Header Row Every Year
Each Year will get a new File with the New Year-Month as a header Row.
How to Unpivot the data.
Sample Data :
| Key | Jan-23 | Feb-23 | Mar-23 | Apr-23 |
| AA1 | 454 | 46 | 67 | 778 |
| AA2 | 54 | 123 | 7545 | 57 |
| AA3 | 6564 | 56 | 656 | 656 |
| AA4 | 34 | 245 | 657 | 55 |
| AA5 | 2342 | 34 | 23 | 54 |
| AA6 | 56 | 12 | 354 | 454 |
| AA7 | 787 | 5464 | 123 | 123 |
| AA8 | 234 | 57 | 56 | 679 |
| Key | Jan-24 | Feb-24 | Mar-24 | Apr-24 |
| AA1 | 54 | 43 | 545 | 778 |
| AA2 | 545 | 6 | 3423 | 3 |
| AA3 | 65 | 56 | 656 | 656 |
| AA4 | 34 | 7 | 23 | 7776 |
| AA5 | 2342 | 56 | 34 | 54 |
| AA6 | 6 | 7 | 354 | 454 |
| AA7 | 787 | 4545 | 434 | 43 |
| AA8 | 234 | 57 | 56 | 34 |
4 Replies
- wdx223_DanielCommunity Champion
=Table.UnpiovtOtherColumns(PreviousStepName,{"Key"},"MonthYear","Value")
- Annu2847_ANew Member
Thanks wdx223_Daniel / for the Response.
The Above I have already tried but, But I feel this doesn't work when another file comes in into same dataset. for another Year.
If you see below i have exported 2 year of Data, but even if i will make first row as header , In the Header Row will have year 2023, But same will get unpivoted. Even Year 2024 Data will get unpivoted with 2023 only.
That's where i am facing the issue. in the same dataset every year , i have add the files, But Header Row has to be changed every year.
- JP_WiscoHelper I
It looks like you are combining files from multiple years. You will want to apply the unpivot recommended by wdx223_Daniel to your sample transformation query. You can then hop back into your main query after the files are combined and repivot or transform however you need.