Forum

Notifications
Clear all

YTD sum of [month] columns in Power Query, based on my selection [month] from Excel

3 Posts
3 Users
0 Reactions
377 Views
(@caroltxy)
Posts: 17
Eminent Member
Topic starter
 

Hi All, 

I'm now struggling to get dynamically sum up columns, based on an input selection from Excel.

From the table below, you can see [Jan] -> [Dec] displayed from Column B to M. 

Column A Column B Column C Column D Column I Column J Column K Column L Column M
  Jan Feb Mar Aug Sept Oct Nov Dec
Sales 100 100 100 100 100 100 100 100
Expense 100 100 100 100 100 100 100 100

 

Base on my month selection in Cell below (let's assume this is Cell N1), i want Query to auto sum figures from [Jan] column B up to [ending month] input in excel cell N1. 

Month
Oct

How could i make it dynamic in P.Query Editor? Thanks alot 🙂 

 
Posted : 10/11/2022 2:26 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Tan,

Your data is in the wrong layout which is resulting in the wrong approach. You should use Power Query to unpivot the month columns, then you can use a PivotTable to create the summary you want.

If you're still stuck, please provide a sample Excel file with your data and desired result so we can help you further.

Mynda

 
Posted : 10/11/2022 3:18 am
(@mel)
Posts: 2
New Member
 

Hi Tan,

attached is an example of calculation with Power Query.
Does this help you?

Mel

 
Posted : 30/11/2022 6:00 am
Share: