The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I am trying to use the PATH function in power bi but my data uses dummy values to denote when the top level parent.
For example,
child parent
1 0
2 1
3 2
Here, 0th id doesn't exist. Now, this doesn't always have to be 0. It can be any number as parent id which is used as dummy where the hierachy is at the top and the parent with whichever id it is doesn't exist.
Any way to go pass this issue?
My object is to see the top parent here which would be 1 and not 0 (0 doesn't exist anyways)
Solved! Go to Solution.
hello @afaro
looks like you need to do make rank or index to find 2nd top.
Here i modify your sample data.
if the non-exist value is zero or blank, RANKX will count it as 1.
So the 2nd top of your data will be the data with rank greater than 1.
i.e to find 2nd top most parent will be:
it will calculate the minimum parent value with rank greater than one.
Hope this will help you.
Thank you.
hello @afaro
looks like you need to do make rank or index to find 2nd top.
Here i modify your sample data.
if the non-exist value is zero or blank, RANKX will count it as 1.
So the 2nd top of your data will be the data with rank greater than 1.
i.e to find 2nd top most parent will be:
it will calculate the minimum parent value with rank greater than one.
Hope this will help you.
Thank you.
User | Count |
---|---|
12 | |
9 | |
6 | |
6 | |
6 |
User | Count |
---|---|
24 | |
14 | |
14 | |
9 | |
7 |