Forum Discussion
Anonymous
2 years agoNot applicable
TREATAS with variables as inputs
My struggle to learn and comprehend the intricacies of TREATAS continues (not that I'm complaining, learning is fun). Thanks for solving my previous problem, which was mainly self-inflicted by not...
Anonymous
2 years agoNot applicable
DallasBaba Still the same issue.
DallasBaba
Skilled Sharer
2 years agoAnonymous can you share the pbix sample data, or replace the code with the following and check if it works for your specific case.
VAR A_TreatAs =
TREATAS (
SUMMARIZE(P_B, P_B[ProductKey], P_B[Name], P_B[Brand]),
ADDCOLUMNS(
SUMMARIZE(P_A, P_A[ProductKey], P_A[Name], P_A[Brand]),
"DummyColumn", 1
)
)
VAR Result =
NATURALLEFTOUTERJOIN ( P_A, A_TreatAs )
RETURN ResultNote: A "DummyColumn" will be added to the SUMMARIZE result of P_A to make it a fully qualified table, which can then be used in the TREATAS function. This should bypass the "Function TREATAS expects a fully qualified column reference" error.