Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Dear Power BI Representative,
I am reviewing the DAX measure in chapter 11 figure 11-19 in the Definitive Guide to DAX and I do not understand what the PersonsAtParentLevel is trying to do at each personkey.
I do not understand what Persons[ParentKey] = CurrentPersonKey means and how does it equate to 0? You're insight on this measure would be greatly appreciated.
IsLeaf =
VAR CurrentPersonKey = Persons[PersonKey]
VAR PersonsAtParentLevel =
CALCULATE (
COUNTROWS ( Persons ),
ALL ( Persons ),
Persons[ParentKey] = CurrentPersonKey
)
VAR Result = ( PersonsAtParentLevel = 0 )
RETURN
Result
Thank you.
Solved! Go to Solution.
@lt79_Pax , I am assuming this a column
This is value in a current row -Persons[PersonKey]
now you are counting does it exists as parent id
CALCULATE (
COUNTROWS ( Persons ),
ALL ( Persons ),
Persons[ParentKey] = CurrentPersonKey
)
Then you are checking if count = 0, which mean its does not exists as a parent , so it is a leaf node.
Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.
@lt79_Pax , I am assuming this a column
This is value in a current row -Persons[PersonKey]
now you are counting does it exists as parent id
CALCULATE (
COUNTROWS ( Persons ),
ALL ( Persons ),
Persons[ParentKey] = CurrentPersonKey
)
Then you are checking if count = 0, which mean its does not exists as a parent , so it is a leaf node.
Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.
Thank you amitchandak. You solved my problem.
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 42 | |
| 37 | |
| 34 | |
| 21 | |
| 16 |
| User | Count |
|---|---|
| 65 | |
| 62 | |
| 31 | |
| 26 | |
| 25 |