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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
pbiforum123
Post Patron
Post Patron

How to create the Hierarchy using ID's

Using the attached data hierarchy has been created in the SAP. I have been asked to create similar hierarchy in Power BI with the same set of data. We have don't have any knowledge about how it was implemented in SAP. I tried to google about this and tried but couldn't succeed. Can someone please help me out on this.

 

I am not sure how can I attach the files here. It is little strange that I dont see any option to upload the file here.

10 REPLIES 10
v-gizhi-msft
Community Support
Community Support

Hi,

 

According to your description, I think that your data is like this:

31.PNG

If so, you can use PATH  dax expression:

 

Relationship = PATH('Test'[Child],'Test'[Parent])

 

And the result shows:

32.PNG

 

Best Regards,

Giotto Zhi

I have already developed the hierarchy but thanks a lot for the explanation.

 

Any idea how we can use the PATH function when one child belongs to two different parents. I know if we can get different id for child then it will not be an issue but what if the child id is same? Please help...

Hi,

 

By using PATH function, If you have the same Child value but belongs to different Parent value, it will return error;

Or if belonging to same Parent Value, it will return this Parent value:

51.PNG

Reference:

https://docs.microsoft.com/en-us/dax/path-function-dax#remarks

 

Best Regards,

Giotto Zhi

Yes I know that... That is where I needed your help... Any idea how to overcome multiple parent scenario?

Hi,

After my much test, I think I cannot completely reach your requirement.
It's difficulty increasing a lot when relationship between Child and Parent fields become complex.

Best Regards,
Giotto Zhi

Yes I know it is very difficult. Thanks a lot for trying.

 

I have one more question.. Do you have any idea how we can sort the hierarchy based on particular column which is not there in the hierarchy?

 

 

Hi,

 

Could you please give me some simple examples by screenshot?

 

Best Regards,

Giotto Zhi

The links that you have shared explains about how to just drag and drop the levels os hierarchy in order which is already there in the data set but where as in my case we dont have the levels columns in the data set we need to create the levels based on the child and parent ID's. Hope you have got it?

Yes! I am unable to attach the excel file here. Any idea about this?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.