Forum Discussion
Addcolumns -- Referencing previously added column in calculate
Hi all,
I'm writing a query with Addcolumns and need the result of previously added columns for further columns. To achieve this I'm nesting Addcolumns to use column references of columns added in the previous Addcolumns.
Please see example below.
Now I would need to use a previously added column in a new column using calculate, but referencing the column in calculate does not work
Why can I reference the [C2] column in DIVIDE but not in CALCULATE?
Thanks in advance.
Best regards
Hi ITManuel,
The '[C2]' column is a generated column in the virtual table, it was not generated when you referenced [C2] in the virtual table.
If you want to reference [C2], you need to create the metric to reference it after the calculation table is generated.If you still have some question, please don't hesitate to let me known.
Best Regards,
Link
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!
3 Replies
- CNENFRNL
Community Champion
Here's a former thread on this subject
Solved: DAX: Is it possible to refer to columns of a table... - Microsoft Power BI Community
- v-xulin-mstf
Community Support
Hi ITManuel,
The '[C2]' column is a generated column in the virtual table, it was not generated when you referenced [C2] in the virtual table.
If you want to reference [C2], you need to create the metric to reference it after the calculation table is generated.If you still have some question, please don't hesitate to let me known.
Best Regards,
Link
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!