Power Query Problems

Unpivot Excel Budget Data with Power Query for Power BI

Amos GikundaAmos Gikunda Nov 18, 2026 871 views

Question details

Convert monthly budget columns in Excel workbooks into a normalized table for Power BI.

Unpivot Excel Budget Data with Power Query for Power BI
Product
Microsoft Excel Power Query and Power BI
Device & OS
not provided
Scenario
A user needs to reshape wide budget tables across approximately 75 workbooks into Category, Budget, Month, and Year columns.
Observed behavior
The desired result is one row per category and month, ready to load into Power BI.
Before you start

Check that each source table has a category column and month headers that include a year, such as Jan 2024. For folder-based combining, place similarly structured workbooks in one folder and confirm that the relevant sheet or table is named consistently.

Solution 1Recommended

Unpivot budget columns with Excel Power Query

Use this refreshable approach to reshape budget data and combine similarly structured workbooks.

The steps below assume month headers use the format Jan 2024. If yours use a different format, adjust the date parsing expression to match.

1
Connect to the source

In Excel, select Data > Get Data > From File > From Workbook for one workbook. For multiple similarly structured files, choose Data > Get Data > From File > From Folder, select the folder, and use Combine & Transform Data.

2
Prepare the headers

In Power Query Editor, select Home > Remove Rows > Remove Top Rows if there are unnecessary rows above the headers. Then select Home > Use First Row as Headers if needed, and remove columns that are not part of the budget table.

3
Unpivot the months

Select the Category column, then choose Transform > Unpivot Columns > Unpivot Other Columns. Rename Attribute to Month Header and Value to Budget.

4
Create the month and year

Select Add Column > Custom Column and create a column named Month Date with Date.FromText("1 " & [Month Header], [Format="d MMM yyyy", Culture="en-US"]). Select Month Date, then use Add Column > Date > Month > Name of Month and Add Column > Date > Year > Year. Rename the new columns Month and Year.

5
Load and refresh the results

Remove Month Header and Month Date, set appropriate data types, and select Home > Close & Load to load the result into an Excel table. In Power BI Desktop, use Home > Get Data > Excel workbook to import that table. After source files change, refresh the Excel query, save the workbook, and refresh the Power BI dataset.

Unpivot budget columns with Excel Power Query
Check the combined data: The folder combine operation applies the sample-file transformation to each file, so inconsistent sheet names or layouts may need separate handling. Power Query unpivoting omits null values; check whether blank budget cells should be represented in the result.
Free Microsoft Office alternative

Review Excel budget workbooks with WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for reviewing and editing budget spreadsheets. Its Excel format compatibility makes it easy to move existing workbooks into WPS Office. Use Microsoft Power Query for the refreshable unpivot and Power BI workflow described above.

Review and edit monthly budget tables in WPS SpreadsheetOpen and save Microsoft Excel formats, including XLSXWork in a familiar spreadsheet interfaceMove existing Office documents into a lightweight, free suite
microsoft office alternative - wps office

Frequently Asked Questions

How do I combine 75 budget workbooks in Power Query?

Place similarly structured workbooks in one folder, then select Data > Get Data > From File > From Folder in Excel. Choose Combine & Transform Data and apply the cleanup and unpivot steps to the sample file.

What if my month headers use a different date format?

Adjust the Custom Column date expression to match the actual headers. For example, the expression in this guide expects headers such as Jan 2024 and uses the en-US culture.

How do I get the transformed table into Power BI?

In Power Query Editor, select Home > Close & Load to create an Excel table. Save the workbook, then in Power BI Desktop select Home > Get Data > Excel workbook and choose that table.

Will the results update when source workbooks change?

Refresh the Excel query from Data > Refresh All and save the workbook. Then refresh the Power BI dataset to import the updated table.

Can VBA unpivot the budget data instead?

Yes. A VBA macro can loop through category rows and month columns and write one output row for each budget value. Power Query is generally easier to maintain and refresh across many similarly structured workbooks.