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
ksivaganesh99
Helper II
Helper II

Hierarchy report displaying column values at all levels

I have the below sample data and need to display hirearchial report with all the column fields based on that data.

Tables are linked in data model using foreignkey. Table A Table B  TableC Table D.  

SampleData.png

 
 

Please help me in the approach I can take to acheive this. Any help is highly appreciable.

1 ACCEPTED SOLUTION

Hello @ksivaganesh99 ,

 

Just loaded the tables in a PBI Report and tried to do a model: it was not possible with One to Many relationships as Table B and C are containing duplicate rows,

Removed the duplicates and tried to do a model in file "Tables A B C D.pbix". Also did a PQ Merge from the tables and you have the results on the second page.

Tables ABCD Duplicates removed.png

 

 

Still I wanted to do the merge as I initially wanted and built another file (Tables A B C D (B and C with duplicates.pbix) with two solutions inside as I don't know all the details of the hierachy that you need.

Tables ABCD Merged.png

 

Tables ABCD Merged and Unpivoted.png

 

As I can't attach the files please leave an email address and I'll be glad to send them to you for detailed study.

 

 

If you liked my solution please give it a thumbs up 👍

If I did answer your question please mark my post as a solution .

Thank you !

Regards,

 

Cristian

 

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@ksivaganesh99 

Looking at the structure Merge is the best option. But this has been a real data Append can be explored.

 

Refer to this link: https://radacad.com/append-vs-merge-in-power-bi-and-power-query

Try to use merge

Cristian_Angyal
Advocate III
Advocate III

Hello @ksivaganesh99 ,

 

I would connect to each table with Power Query, build a separate query to merge all of them and load  only the last query to the model and build a Matrix table out of it,

 

If you could post the sample excel file I could give it a try,

 

 

If you liked my solution please give it a thumbs up 👍

If I did answer your question please mark my post as a solution .

Thank you !

 

 

Cristian

 

 

Thanks for the suggestion. Really appreciate. I pasted all the tables below. Please give a try and let me know the output.

Table A

TableAIDTableADescriptionTableATitleTableAStatusTabelBForeignKey
1atable a desc 1table a title 1table a status 11b
2atable a desc 2table a title 2table a status 22b
3atable a desc 3table a title 3table a status 33b
3atable a desc 3table a title 3table a status 34b

 

Table B

TableBIDTableBDescriptionTableBTitleTableBStatusTabelCForeignKey
1btable b desc 1table b title 1table b status 11c
2btable b desc 2table b title 2table b status 22c
3btable b desc 3table b title 3table b status 33c
3btable b desc 3table b title 3table b status 33c

 

Table C

TableCIDTableCDescriptionTableCTitleTableCStatusTabelDForeignKey
1ctable c desc 1table c title 1table c status 11d
2ctable c desc 2table c title 2table c status 22d
3ctable c desc 3table c title 3table c status 33d
3ctable c desc 3table c title 3table c status 33d

Table D

TableDIDTableDDescriptionTableDTitleTableDStatus
1dtable d desc 1table d title 1table d status 1
2dtable d desc 2table d title 2table d status 2
3dtable d desc 3table d title 3table d status 3
4dtable d desc 3table d title 3table d status 3

 

@Cristian_Angyal  Thanks in advance.

Hello @ksivaganesh99 ,

 

Just loaded the tables in a PBI Report and tried to do a model: it was not possible with One to Many relationships as Table B and C are containing duplicate rows,

Removed the duplicates and tried to do a model in file "Tables A B C D.pbix". Also did a PQ Merge from the tables and you have the results on the second page.

Tables ABCD Duplicates removed.png

 

 

Still I wanted to do the merge as I initially wanted and built another file (Tables A B C D (B and C with duplicates.pbix) with two solutions inside as I don't know all the details of the hierachy that you need.

Tables ABCD Merged.png

 

Tables ABCD Merged and Unpivoted.png

 

As I can't attach the files please leave an email address and I'll be glad to send them to you for detailed study.

 

 

If you liked my solution please give it a thumbs up 👍

If I did answer your question please mark my post as a solution .

Thank you !

Regards,

 

Cristian

 

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.