Forum Discussion
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
- amitchandak
Super User
Not able to see any attachment. But refer
Hierarchy
https://www.tutorialgateway.org/create-hierarchy-in-power-bi/
https://community.powerbi.com/t5/Desktop/How-to-create-Hierarchy/td-p/479913
https://stoneridgesoftware.com/creating-hierarchies-in-power-bi/
https://guyinacube.com/2019/08/07/how-to-create-and-use-a-power-bi-hierarchy/- pbiforum123
Post Patron
Yes! I am unable to attach the excel file here. Any idea about this?
- pbiforum123
Post Patron
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?
- v-gizhi-msft
Community Support
Hi,
According to your description, I think that your data is like this:
If so, you can use PATH dax expression:
Relationship = PATH('Test'[Child],'Test'[Parent])And the result shows:
Best Regards,
Giotto Zhi
- pbiforum123
Post Patron
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...
- v-gizhi-msft
Community Support
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:
Reference:
https://docs.microsoft.com/en-us/dax/path-function-dax#remarks
Best Regards,
Giotto Zhi