Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Create folder structure with ids

Hello guys,

I need your help around a folder structure. In the screenshot are the names of the folders and the IDs. The fk_id always points to the parent folder. The data is not complete so don't be surprised if some fk_ids can't be found in the column id. What is the best way to create a proper and correct order structure over several levels?

Robin98908_0-1647440325469.png

 

 

The folder structure should look like this at the end.

Robin98908_1-1647440419298.png

 

Thanks for your help

Robin 

1 ACCEPTED SOLUTION
Hariharan_R
Solution Sage
Solution Sage

Hi @Anonymous 

You can achieve this with DAX PATH functions. You need to add calculated columns for all the levels.

 

Full Hierarchy = PATH('Sample'[id],'Sample'[fk_id])
Level 1 = LOOKUPVALUE('Sample'[name],'Sample'[id],PATHITEM('Sample'[Full Hierarchy],1,1))
Level 2 = LOOKUPVALUE('Sample'[name],'Sample'[id],PATHITEM('Sample'[Full Hierarchy],2,1))
Level 3 = LOOKUPVALUE('Sample'[name],'Sample'[id],PATHITEM('Sample'[Full Hierarchy],3,1))

Hariharan_R_2-1647535464163.png

 

 

Hariharan_R_1-1647535436225.png

 

Result

Hariharan_R_0-1647535410242.png

Thanks

Hari

 

If this helps to achieve the solution then please accept this as a solution.

View solution in original post

1 REPLY 1
Hariharan_R
Solution Sage
Solution Sage

Hi @Anonymous 

You can achieve this with DAX PATH functions. You need to add calculated columns for all the levels.

 

Full Hierarchy = PATH('Sample'[id],'Sample'[fk_id])
Level 1 = LOOKUPVALUE('Sample'[name],'Sample'[id],PATHITEM('Sample'[Full Hierarchy],1,1))
Level 2 = LOOKUPVALUE('Sample'[name],'Sample'[id],PATHITEM('Sample'[Full Hierarchy],2,1))
Level 3 = LOOKUPVALUE('Sample'[name],'Sample'[id],PATHITEM('Sample'[Full Hierarchy],3,1))

Hariharan_R_2-1647535464163.png

 

 

Hariharan_R_1-1647535436225.png

 

Result

Hariharan_R_0-1647535410242.png

Thanks

Hari

 

If this helps to achieve the solution then please accept this as a solution.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.