Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. 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.
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.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 51 | |
| 37 | |
| 35 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 70 | |
| 64 | |
| 39 | |
| 33 | |
| 23 |