This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. 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.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 34 | |
| 32 | |
| 25 | |
| 21 | |
| 16 |
| User | Count |
|---|---|
| 61 | |
| 49 | |
| 28 | |
| 23 | |
| 23 |