Forum Discussion
Why does CALCULATETABLE not register as a single column when used as TREATAS
- 1 year ago
When doing it without just CALCULATETABLE like this:
VAR RewnewedPolicies = CALCULATETABLE(VALUES(Fact_VT[PN]), ...)
you will get a single-column table, but the column retains its original metadata and name (Fact_VT[PN]). TREATAS cannot reliably bind a source column with metadata tied to another table into a new context without ambiguity.SELECTCOLUMNS flattens this ambiguity, you get a column with a defined name ("__PN")
So, effectively, SELECTCOLUMNS is your insurance policy that the shape of the table matches TREATAS' expectations.
Please mark this post as a solution if it helps you. Appreciate Kudos.
When doing it without just CALCULATETABLE like this:
VAR RewnewedPolicies =
CALCULATETABLE(VALUES(Fact_VT[PN]), ...)
you will get a single-column table, but the column retains its original metadata and name (Fact_VT[PN]). TREATAS cannot reliably bind a source column with metadata tied to another table into a new context without ambiguity.
SELECTCOLUMNS flattens this ambiguity, you get a column with a defined name ("__PN")
So, effectively, SELECTCOLUMNS is your insurance policy that the shape of the table matches TREATAS' expectations.
Please mark this post as a solution if it helps you. Appreciate Kudos.
Amazing explanation, much appriciated and good to understand.
Thanks,
Will