Create a measure to calculate a variable number of columns
up vote
0
down vote
favorite
I have an ODATA data source that, simplified, has the following columns:
Name
LifetimeBudget
FY2016Budget
FY2017Budget
...
FY2070Budget
I want to create a pivot table that will display the fields above in the following order:
Name, FYxxxxBudget, ..., FYxxxxBudget, SelectedYearsBudget,
LifetimeBudget
The FYxxxxBudgets are a range where the user can select which years they are interested in and the SelectedYearsBudget column would display a calculated total for only the included years (where LifetimeBudget is from the datasource, but contains the total budget over all years in the table - this can be recreated as a calculated field if it helps).
For example:
Name FY2020Budget FY2021Budget FY2022Budget SelectedYearsBudget LifetimeBudget
HR $200,000 $200,000 $210,000 $610,000 $2,000,000
IT $300,000 $300,000 $310,000 $910,000 $3,000,000
And so on. If the user adds the FY2023Budget column, SelectedYearsBudget changes to reflect the new column in its total. Further, SelectedYearsBudget will be used as a filter (we don't care to see any items where SelectedYearsBudget is 0).
Doing this as a single pivot table is ideal, but if intermediate pivot tables are needed, or some VB coding, or a display page pulling values from the table with LOOKUP or other reference functions is needed, that is okay - my current solution is a Frankenstein's Monster of all of the above (except VBA) with the problem being that the intermediate table doesn't update when underlying filters change.
microsoft-excel pivot-table
add a comment |
up vote
0
down vote
favorite
I have an ODATA data source that, simplified, has the following columns:
Name
LifetimeBudget
FY2016Budget
FY2017Budget
...
FY2070Budget
I want to create a pivot table that will display the fields above in the following order:
Name, FYxxxxBudget, ..., FYxxxxBudget, SelectedYearsBudget,
LifetimeBudget
The FYxxxxBudgets are a range where the user can select which years they are interested in and the SelectedYearsBudget column would display a calculated total for only the included years (where LifetimeBudget is from the datasource, but contains the total budget over all years in the table - this can be recreated as a calculated field if it helps).
For example:
Name FY2020Budget FY2021Budget FY2022Budget SelectedYearsBudget LifetimeBudget
HR $200,000 $200,000 $210,000 $610,000 $2,000,000
IT $300,000 $300,000 $310,000 $910,000 $3,000,000
And so on. If the user adds the FY2023Budget column, SelectedYearsBudget changes to reflect the new column in its total. Further, SelectedYearsBudget will be used as a filter (we don't care to see any items where SelectedYearsBudget is 0).
Doing this as a single pivot table is ideal, but if intermediate pivot tables are needed, or some VB coding, or a display page pulling values from the table with LOOKUP or other reference functions is needed, that is okay - my current solution is a Frankenstein's Monster of all of the above (except VBA) with the problem being that the intermediate table doesn't update when underlying filters change.
microsoft-excel pivot-table
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have an ODATA data source that, simplified, has the following columns:
Name
LifetimeBudget
FY2016Budget
FY2017Budget
...
FY2070Budget
I want to create a pivot table that will display the fields above in the following order:
Name, FYxxxxBudget, ..., FYxxxxBudget, SelectedYearsBudget,
LifetimeBudget
The FYxxxxBudgets are a range where the user can select which years they are interested in and the SelectedYearsBudget column would display a calculated total for only the included years (where LifetimeBudget is from the datasource, but contains the total budget over all years in the table - this can be recreated as a calculated field if it helps).
For example:
Name FY2020Budget FY2021Budget FY2022Budget SelectedYearsBudget LifetimeBudget
HR $200,000 $200,000 $210,000 $610,000 $2,000,000
IT $300,000 $300,000 $310,000 $910,000 $3,000,000
And so on. If the user adds the FY2023Budget column, SelectedYearsBudget changes to reflect the new column in its total. Further, SelectedYearsBudget will be used as a filter (we don't care to see any items where SelectedYearsBudget is 0).
Doing this as a single pivot table is ideal, but if intermediate pivot tables are needed, or some VB coding, or a display page pulling values from the table with LOOKUP or other reference functions is needed, that is okay - my current solution is a Frankenstein's Monster of all of the above (except VBA) with the problem being that the intermediate table doesn't update when underlying filters change.
microsoft-excel pivot-table
I have an ODATA data source that, simplified, has the following columns:
Name
LifetimeBudget
FY2016Budget
FY2017Budget
...
FY2070Budget
I want to create a pivot table that will display the fields above in the following order:
Name, FYxxxxBudget, ..., FYxxxxBudget, SelectedYearsBudget,
LifetimeBudget
The FYxxxxBudgets are a range where the user can select which years they are interested in and the SelectedYearsBudget column would display a calculated total for only the included years (where LifetimeBudget is from the datasource, but contains the total budget over all years in the table - this can be recreated as a calculated field if it helps).
For example:
Name FY2020Budget FY2021Budget FY2022Budget SelectedYearsBudget LifetimeBudget
HR $200,000 $200,000 $210,000 $610,000 $2,000,000
IT $300,000 $300,000 $310,000 $910,000 $3,000,000
And so on. If the user adds the FY2023Budget column, SelectedYearsBudget changes to reflect the new column in its total. Further, SelectedYearsBudget will be used as a filter (we don't care to see any items where SelectedYearsBudget is 0).
Doing this as a single pivot table is ideal, but if intermediate pivot tables are needed, or some VB coding, or a display page pulling values from the table with LOOKUP or other reference functions is needed, that is okay - my current solution is a Frankenstein's Monster of all of the above (except VBA) with the problem being that the intermediate table doesn't update when underlying filters change.
microsoft-excel pivot-table
microsoft-excel pivot-table
asked Nov 21 at 18:15
cpcodes
1013
1013
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1377375%2fcreate-a-measure-to-calculate-a-variable-number-of-columns%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown