Dynamically change the columns in table

Hello.
Suppose that I have columns A, B, C, D, E, and a parameter P.
If P=1, then i want to show in a table visual only columns A, C, D.
if P=2, then i want to show only columns B, E.

What is the best way that I can achieve this?
Is it somehow possible that a metric can return a list?

Hi fsotiros,

Welcome to the QuickSight community.

One possible way to accomplish this is using QuickSight free form layout with 2 tables visuals.
Table 1— with column A, C, D
Table 2 — with column B,E

Depending on parameter value of p show only one of the table. As demonstrated in the following Community question Hide visual based on filters - #4 by robdhondt

1 Like

Hi @fsotiros
As @AnwarAli suggested. Because you want to show 2 and 3 columns. In case of similar column count you could use
2/3 calculated fields that are displaying e.g. A or B and C or E.
BR

Hello @fsotiros !

It has been a few days since we have heard from you but would still like to help you find a solution. Was @AnwarAli or @ErikG 's suggestions helpful, and if so could you mark their comment as the solution to help the community?

If we do not hear from you in the 7 days this post will be archived.