Month to date, last month to date, last year to date

gazmoz17

Board Regular
Joined
Sep 18, 2020
Messages
158
Office Version
  1. 365
Platform
  1. Windows
Hi,

I wish to create a current month report.
KPI: Sales, Profit

So a snap shot of how were doing this month compared to last month and last years month all to dates. So in Sept now…so Sept 23 mtd, Aug 23 mtd and Sept 22 mtd.

Is this possible based on vba populating a cell with todays date. Have this cell as a date parameter to automatically bring relevant info in as workbook open event. Would I have a pivot tables for those 3 dates and the pivots are linked to 3 seperate power queries filtered by the cell parameter?

Not sure how to do it. Currently I just have a “Source query” which is all 2023 sales data. Can access 2022 data. But I want it to be dynamic so this time next year it runs itself upon opening the workbook. Can you tell Power query to look back 12 months of data from todays date (parameter cell). I dont want my “Soruce query” too big with historical data I dont need.

Any advisal much appreciated.

Thanks
Gareth
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Hi,

I wish to create a current month report.
KPI: Sales, Profit

So a snap shot of how were doing this month compared to last month and last years month all to dates. So in Sept now…so Sept 23 mtd, Aug 23 mtd and Sept 22 mtd.

Is this possible based on vba populating a cell with todays date. Have this cell as a date parameter to automatically bring relevant info in as workbook open event. Would I have a pivot tables for those 3 dates and the pivots are linked to 3 seperate power queries filtered by the cell parameter?

Not sure how to do it. Currently I just have a “Source query” which is all 2023 sales data. Can access 2022 data. But I want it to be dynamic so this time next year it runs itself upon opening the workbook. Can you tell Power query to look back 12 months of data from todays date (parameter cell). I dont want my “Soruce query” too big with historical data I dont need.

Any advisal much appreciated.

Thanks
Gareth

I think you should post this in the Power Tools forum.

But also, Mr. excel has a tool called xl2bb where you can post miniworkbooks of your data and formulas. Please post your 2023 and 2022 anonymized sample data so the forum can help you. If you can't use the tool, then please post your data in Tables.

Thanks in advance.
 
Upvote 0
I think you should post this in the Power Tools forum.

But also, Mr. excel has a tool called xl2bb where you can post miniworkbooks of your data and formulas. Please post your 2023 and 2022 anonymized sample data so the forum can help you. If you can't use the tool, then please post your data in Tables.

Thanks in advance.
Hi, thats great…thanks for this will do 👍 much appreciated.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top