Forum Discussion
garythomannCoGC
Impactful Individual
3 years agodax syntax - calculate(table) vs filter context transition and return confusion
Dax query to emulate power bi dashboard report table results. Hierarchical model of parent (pml) < child (mbm) < child (mbpl).
DaxStudio screenshot below. "VAR pml_id" gives same error as shown....
- 3 years ago
Yes, you've hit the nail on the head: "query tables" created with DEFINE TABLE cannot reference each other!
But variables can 🙂
I'm not sure if your query has evolved since your last post, but I would possibly suggest something like:
EVALUATE VAR pml_id = -- pml.id = 3921 CALCULATE ( MAX ( 'Project Master List'[Id] ), 'Project Master List'[DIR] = "CO", 'Project Master List'[Initiative Name] = "Fleet Business Transformation" ) VAR mbm = CALCULATETABLE ( 'Measure Benefit Master', 'Measure Benefit Master'[DIR] = "CO", 'Measure Benefit Master'[PM IDId] = pml_id ) RETURN mbm
garythomannCoGC
Impactful Individual
3 years agoPosting the final working solution(s) for the parent < child model
Run with only mbm changed as per suggestion from Owen
Run with suggested changes to both var queries