Create dynamic columns in Table

I have a dataset that contains multiple columns from different datasets. It is like a merged dataset where 80% of the columns are the same.

Let say the data looks like this:
Row | TYPE | Price | Quantity | Rate
1 | Data1 | 100 | 200 | |
2 | Data2 | 200 | | 5

I want to create a table and depending on the TYPE that I have chosen, I want to see different columns in that table.

If I select TYPE = Data1, I want to see Price and Quantity.
If I have TYPE = Data2, I want to see Price and Rate,
If I have select all, I want to see all three columns.

Currently, I am able to create two tables and show/hide one depending on the TYPE that I have chosen. But if I have both selected, or if I have a third type, then the logic complicates more and more.

But it is really hard to manually add all the columns, and I have around 30-40 for each dataset. Is there a simpler way to do this? Where I can do set logic on the columns and create a measure where I can dynamically return which columns I want?

HI @fsotiros
check out the Dynamic Dimensions and Measures demo within democentral.
https://democentral.learnquicksight.online/#Dashboard-TipsAndTricks-Interactivity-Dynamic-Dimensions-and-Measures
BR