exam questions

Exam PL-300 All Questions

View all questions & answers for the PL-300 exam

Exam PL-300 topic 2 question 60 discussion

Actual exam question from Microsoft's PL-300
Question #: 60
Topic #: 2
[All PL-300 Questions]

You have a Power BI model that contains a table named Employee. The table contains the following data.



Each employee has one manager as shown in the ParentEmployeeID column.

All reporting paths lead to the CEO at the top of the organizational hierarchy.

You need to create a calculated column that returns the count of levels from each employee to the CEO.

Which DAX expression should you use?

  • A. PATHLENGTH(PATH(Employee[EmployeeID],Employee[ParentEmployeeID]))
  • B. PATHITEM(PATH(Employee[EmployeeID],Employee[ParentEmployeeID]),1,INTEGER)
  • C. PATHCONTAINS(PATH(Employee[EmployeeID],Employee[ParentEmployeeID]),1)
  • D. PATH(Employee[EmployeeID],Employee[ParentEmployeeID])
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
svg10gh
Highly Voted 2 years, 3 months ago
A is correct answer. This video proves all https://www.youtube.com/watch?v=uE0G6gLz7WM
upvoted 35 times
JudT
1 year ago
Great link. Ta
upvoted 1 times
...
Nass75
2 years ago
Thanks for the video link.
upvoted 2 times
...
IVO999
1 year, 8 months ago
Thanks!
upvoted 1 times
...
hativo5113
1 year, 7 months ago
what a great video man.
upvoted 2 times
...
...
ewelaela
Highly Voted 2 years, 3 months ago
Selected Answer: A
Answer A is correct - tested Although for CEO it returns 1 - so I personally would substract 1 from this PATHLENGTH when creating the report, as I think numbers of levels from CEO to CEO is 0, formanagaers directly under CEO it is 1 etc
upvoted 25 times
gaikwpa
1 year, 9 months ago
PATH will give this - ToTop 100 100|101 100|102 100|101|103 100|101|103|104 100|101|103|105 100|102|106 PATHLENGTH(PATH...) will give this 1 2 2 3 4 4 3
upvoted 17 times
...
...
539d541
Most Recent 8 months ago
Selected Answer: A
A is correct
upvoted 1 times
...
rcaliandro
8 months, 1 week ago
Selected Answer: A
Tested! A is the correct option, it returns the number of levels from the CEO. B always returns 100, C returns a boolean, and D return the concatenation of the paths
upvoted 1 times
...
applushka
1 year, 3 months ago
Selected Answer: A
tested in PBI, PATHLENGTH(PATH(Employee[EmployeeID],Employee[ParentEmployeeID])) will return the count of levels including 1 for the CEO itself as ewelaela mentioned earlier
upvoted 1 times
applushka
1 year, 3 months ago
PATHLENGTH return 1 for top level
upvoted 1 times
...
...
Igetmyrole
1 year, 7 months ago
A is correct answer. This expression calculates the path length from each employee to the CEO, effectively giving you the count of levels in the hierarchy.
upvoted 1 times
...
ngoduytien
1 year, 11 months ago
A https://learn.microsoft.com/en-us/dax/pathlength-function-dax
upvoted 3 times
...
RazaTheLegend
2 years ago
Selected Answer: A
Answer A is correct - tested Although for CEO it returns 1 - so I personally would substract 1 from this PATHLENGTH when creating the report, as I think numbers of levels from CEO to CEO is 0, formanagaers directly under CEO it is 1 etc
upvoted 1 times
og44
1 year, 4 months ago
these types of conventions kill me. for example python and nmpy will start their indexes from 0, but pandas will use 1.
upvoted 1 times
...
...
glenman0202
2 years, 2 months ago
Selected Answer: A
According to https://learn.microsoft.com/en-us/dax/path-function-dax, PATH returns a string containing "the identifiers of all the parents to the current identifier", whereas PATHLENGTH returns "the number of items that are parents to the specified item."
upvoted 7 times
...
HemantGorle
2 years, 3 months ago
Selected Answer: A
PathLength function needs a path to travel and provide length of the hierarchy
upvoted 1 times
...
Nuli
2 years, 3 months ago
The Answer is A because the question instructs that we count the different levels of each employee. The PathLength gives the result. For more information see the link https://learn.microsoft.com/en-us/dax/pathlength-function-dax Answer D is wrong because it only returns the items related to the current row value and does not give the count.
upvoted 2 times
...
Sushvij
2 years, 3 months ago
A is correct answer
upvoted 3 times
...
Danylessoucis
2 years, 3 months ago
Correct answer
upvoted 2 times
...
GuerreiroJunior
2 years, 3 months ago
Selected Answer: D
https://simplebiinsights.com/power-bi-path-function-for-parent-child-hierarchies-in-dax/#:~:text=PATH%20function%20returns%20a%20delimited,to%20the%20current%20row%20value.
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago