Forum Discussion
Dynamically add new field to a visual
Hello,
I have the following table displayed in a column chart. The problem is that every week, there could be a new column added. Is it possible to automate the addition of the new column/s to the chart?
I have done some research and found that there is a new preview feature called Field Parameters - can this help to resolve this problem? However, i am not sure how to use it.
| Year | Week number | Stock | Returns | Defective |
| 2022 | 1 | 3 | 4 | 8 |
| 2022 | 2 | 6 | 9 | 17 |
| 2022 | 3 | 2 | 5 | 10 |
| 2022 | 4 | 9 | 3 | 16 |
| 2022 | 5 | 5 | 6 | 15 |
| 2023 | 6 | 2 | 2 | 10 |
| 2022 | 7 | 7 | 8 | 22 |
| 2022 | 8 | 3 | 3 | 13 |
| 2022 | 9 | 6 | 3 | 18 |
| 2022 | 10 | 3 | 3 | 14 |
| 2022 | 11 | 2 | 7 | 17 |
| 2022 | 12 | 3 | 7 | 22 |
| 2022 | 13 | 7 | 5 | 19 |
| 2022 | 14 | 9 | 8 | 18 |
| 2022 | 15 | 6 | 7 | 16 |
| 2022 | 16 | 7 | 14 | 34 |
The following week, the Excel source file could have a new column. In this case, it is the "Sold" column which was added. I am trying to obtain the chart below automatically. Is this possible?
| Year | Week number | Stock | Returns | Defective | Sold |
| 2022 | 1 | 3 | 4 | 8 | 2 |
| 2022 | 2 | 6 | 9 | 17 | 6 |
| 2022 | 3 | 2 | 5 | 10 | 3 |
| 2022 | 4 | 9 | 3 | 16 | 3 |
| 2022 | 5 | 5 | 6 | 15 | 7 |
| 2023 | 6 | 2 | 2 | 10 | 2 |
| 2022 | 7 | 7 | 8 | 22 | 9 |
| 2022 | 8 | 3 | 3 | 13 | 4 |
| 2022 | 9 | 6 | 3 | 18 | 7 |
| 2022 | 10 | 3 | 3 | 14 | 8 |
| 2022 | 11 | 2 | 7 | 17 | 5 |
| 2022 | 12 | 3 | 7 | 22 | 3 |
| 2022 | 13 | 7 | 5 | 19 | 6 |
| 2022 | 14 | 9 | 8 | 18 | 9 |
| 2022 | 15 | 6 | 7 | 16 | 11 |
| 2022 | 16 | 7 | 14 | 34 | 12 |
Any help is much appreciated!
While it's recommended to keep metrics in separate columns, one way to solve this is by unpivoting the metrics columns so that they become a dimension. If any more columns are added, they will be included in the dimension. For it to work properly, select the year and week columns, right click and select "Unpivot other columns".
4 Replies
- AnonymousNot applicable
Hi
Yes just add the field "Sold" at the same place thane stock, return...
- AnonymousNot applicable
Anonymous Hi, i think that there is a confusion. I am trying to have the chart visual be updated automatically with the new fields by just refreshing the dashboard, without the current requirement to drag and drop the new fields into the visualization.
- PaulDBrown
Community Champion
While it's recommended to keep metrics in separate columns, one way to solve this is by unpivoting the metrics columns so that they become a dimension. If any more columns are added, they will be included in the dimension. For it to work properly, select the year and week columns, right click and select "Unpivot other columns".