Calculation Between Two Columns - Rolling 24 Months - New Month Gets Added, Oldest Month Drops Off
I've hit a roadblock on a report I'm working on.
I have data like the attached. It shows a list of locations, then has the revenue for each of the past 24 months and the number of business days in each of the last 24 months. With this, I can calculate daily average growth (DAG).
With static data, it is easy to do the following calculation:
(((Revenue AUG 2019)/(Business Days in AUG 2019))-((Revenue AUG 2018)/(Business Days in AUG 2018)))/(Revenue AUG 2019)/(Business Days in AUG 2019)
The problem is, the oldest month on the report will drop off and be replaced by the most recent month.
In this case, it means that, next month, SEP 2017 will fall off and be replaced by SEP 2019. As such, I can't build a calculation off of existing header names - they will be changing month to month.
Is there a way to do a calculation based off of the column number rather than the column name? For instance, take the above calculation and replace header names with a column number?
Is there another solution I should be searching?
Ideally, when I am done, I will have Revenue, Business Days, and DAG for every sales location for the last 12 months.
This is a sample of the data. It goes out to 48 columns in the query.
Sorry i'm a little confused with your request, could you please share your dummy pbix/complete worksheet to indicate the expected data? list all the column data with expected result and simple logic would be helpful for us to generate the valuable advice.
Community Support Team _ Dina Ye If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.