Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi all,
I would like to copy a column using DAX. The problem is that the column is selected as a parameter.
Example:
Nummer AA BB CC
| 1 | 123 | 111 | |
| 2 | 222 | ||
| 3 | 345 | ||
| 4 | 456 | 456 | |
| 5 | 567 | 876 | |
| 6 | 333 | 333 | |
| 7 | 789 | 444 | |
| 8 | 900 | 555 | |
| 9 | 1011 | 1011 | |
| 10 | 1122 | ||
| 11 | 1233 | ||
| 12 | 654 | ||
| 13 | 1455 | 543 | |
| 14 | 1566 | 777 | 432 |
| 15 | 888 | ||
| 16 | 1788 | 1788 | 321 |
| 17 | 1899 | 1110 |
I have defined a field parameter containing the column names "AA", "BB" and "CC". The column is selected by this parameter.
There is another table (T2) containing only the numbers.
Is there a way to define a new column in T2 that contains the values of the selected column?
My final goal is to copy 2 columns and compare the values. Any idea to do this without the creation of the columns is highly wellcome. I want to present a table visual containing both selected columns and a column for comparison.
Thank you for any help or hint.
PeRoma
Hi,
I think it is not possible in DAX to reference dynamically columns in calculatd tables because they always need to have data copied. I think If you want this you will need to copy all the columns AA, BB, CC and then you can dynamically reference this new calculated table.
Hope it helps!
Hi Savvy,
Thank you for your reply. I was afraid that this would not be possible. But gave me some hope that I can reach my final goal: My goal is, to compare the columns. In the example above there would be TRUE for row 4, 9 and 16 when comparing AA wigh BB. Is it possible to do this comparison e.g. via function EXACT and reference the columns at run time?
Thank you once more for your reply.
Best regards
peroma
Hi PeRoma,
I think with this goal in mind you can use measure with 2 parametes defined in disconnected table.
Here is the screenshot:
Attached pbix:
https://drive.google.com/file/d/1CbcK9erUvMcMJ6jFqvS-6OTR9LdRrTSt/view?usp=sharing
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
My LinkedIn: www.linkedin.com/in/lukasz-kozdron
Hello @PeRoma,
Can you please try this:
CalculatedTable =
ADDCOLUMNS(
SUMMARIZE(T1, T1[Nummer]),
"SelectedValue", SWITCH(TRUE(),
SelectedColumn = "AA", CALCULATE(SUM(T1[AA])),
SelectedColumn = "BB", CALCULATE(SUM(T1[BB])),
SelectedColumn = "CC", CALCULATE(SUM(T1[CC])),
BLANK()
)
)
Hi Sahir,
Thank you for your response.
But sorry, this does not answer my question. My goal to copy the column into table T2. All the values.
If I e.g. select column "AA" from table T1- at run time by any means I want to copy only this column into table T2. The problem is, I don't know how to reference a column dynamically with a parameter, measure or by any other means. This referenced column should then be copied into table T2.
In other words: I have no problem to reference columns within DAX by just naming them. But I want to reference to a column that is only selected at run time. And I want to copy this column.
Thank you for your effort. Do you have any idea based on this explanation?
Best
peroma
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 20 | |
| 11 | |
| 10 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 34 | |
| 32 | |
| 19 | |
| 12 | |
| 10 |