Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello,
I have Financial P&L Matrix, human interface friendly where Rows are the accounts , columns names are actual/(monthyear) or Forecast/(monthyear), and the values in cell are the finacial values. database is something like this:
| country | Account | Actual/Jan2023 | Actual/Feb2023 | Forecast/Mar2023 | Forecast/Apr2024 | Forecast/May2025 | Forecast/Jun2026 |
| United States | Total Revenue | 1000 | 1050 | 1000 | 1050 | 1000 | 1050 |
| United States | Total Cost | 500 | 600 | 500 | 600 | 500 | 600 |
| France | Total Revenue | 1000 | 1100 | 1000 | 1100 | 1000 | 1100 |
| France | Total Cost | 700 | 800 | 700 | 800 | 700 | 800 |
I do unpivot Only selected columns from the functions and the DAX formula goes like this:
Table.Unpivot(#"Expanded romeveheader1", {"Actual/Jan2023", "Actual/Feb2023", "Forecast/Mar2023", "Forecast/Apr2023", "Forecast/May2023", "Forecast/Jun2023"},"Attribute","Value")
Question/challenge:
At the beggining of April 2023 when the account results are available, the column "Forecast/Mar2023" name is going to change to "Actual/Mar2023"
so instead of coming to powerquery and change the column name every month, is there a way that I can unpivot with dymanic column names?
Thanks in advance
Solved! Go to Solution.
Assuming romeveheader1 is not a typo (although removeheader1 seems more likely) and the first two columns are the only ones not unpivoting:
Table.Unpivot(#"Expanded romeveheader1", List.Skip(Table.ColumnNames(#"Expanded romeveheader1"),2),"Attribute","Value")
Thanks for the solution!
Assuming romeveheader1 is not a typo (although removeheader1 seems more likely) and the first two columns are the only ones not unpivoting:
Table.Unpivot(#"Expanded romeveheader1", List.Skip(Table.ColumnNames(#"Expanded romeveheader1"),2),"Attribute","Value")
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 5 | |
| 4 | |
| 3 |