Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount 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")