Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. 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.
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 |
|---|---|
| 44 | |
| 43 | |
| 38 | |
| 19 | |
| 15 |
| User | Count |
|---|---|
| 68 | |
| 64 | |
| 31 | |
| 29 | |
| 24 |