Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Let's say I have a table that looks like this:
| Staff Name | Supervisor |
| Ryan | *blank* |
| Martha | Ryan |
| Erica | Ryan |
| David | Martha |
| Samantha | Erica |
| Kyle | Erica |
How do I build a table or table visual that looks like this?
| Lv. 1 | Lv. 2 | Lv. 3 |
| Ryan | Erica | Samantha |
| Kyle | ||
| Martha | Ryan |
Solved! Go to Solution.
Hi, @BBHouston
You also can try a solution in Dax.
Path = PATH('Dax'[Staff Name],'Dax'[Supervisor])Level1 = PATHITEM('Dax'[Path],1)Level2 = PATHITEM('Dax'[Path],2)Level3 = PATHITEM('Dax'[Path],3)
Best Regards,
Community Support Team _ Eason
Hi, @BBHouston
You also can try a solution in Dax.
Path = PATH('Dax'[Staff Name],'Dax'[Supervisor])Level1 = PATHITEM('Dax'[Path],1)Level2 = PATHITEM('Dax'[Path],2)Level3 = PATHITEM('Dax'[Path],3)
Best Regards,
Community Support Team _ Eason
@v-easonf-msft Thank you!!! This solution ended up being the simplest and working the best for me.
Please see this article on how to use the PATH function to do this.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hi, @BBHouston , you might want to try a solution in Power Query
let
Path = (emp) as text =>
let
sup = suplist{List.PositionOf(emplist, emp, Occurrence.First)},
recursion = if List.PositionOf(emplist, sup) = -1 then "" else @Path(sup) & "|" & sup
in
recursion,
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCqpMzFPSUVKK1YlW8k0sKslIBPLAgiAR16LMZBQBl8SyzBSgAFQpSCg4MTcxD6IPohwk6F2Zk4oQiAUA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Staff Name" = _t, Supervisor = _t]),
emplist = List.Buffer(Source[Staff Name]),
suplist = List.Buffer(Source[Supervisor]),
#"Added Hierarchy" = Table.AddColumn(Source, "Lv", each Path([Staff Name]) & "|" & [Staff Name]),
#"Split Column by Delimiter" = Table.SplitColumn(#"Added Hierarchy", "Lv", Splitter.SplitTextByDelimiter("|", QuoteStyle.Csv), {"Lv0", "Lv1", "Lv2", "Lv3"}),
#"Removed Columns" = Table.RemoveColumns(#"Split Column by Delimiter",{"Staff Name", "Supervisor", "Lv0"}),
#"Filtered Rows" = Table.SelectRows(#"Removed Columns", each ([Lv3] <> null))
in
#"Filtered Rows"| Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |