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
nieps
Regular Visitor

Hierarchy into a hierarchy. Is it possible?

Hi,

I'm trying to build a Profit and Loss report. Information is groupped/organised in different levels and these may have x or y sub-levels.

at the end, the 4digit accont number must be shown.

this means tha in some cases, the account must be shown at a 3rd (x)  info level, other times at 4th (y) info level.

this makes it really difficult to me to crear a master table.

 

I thought that using hierarchies (putting one into another) would help, but I can't see a way to do it.

is it possible? if so.. how?

 

thanks a lot in advance

1 ACCEPTED SOLUTION

Hi @nieps 

 

Do you mean you'd like to set your original data transformed as the solution 2? Move the right column value to fill the left empty one?

You might try the power query something like this:

= Table.ReplaceValue(#"Changed Type","",each [B],Replacer.ReplaceValue,{"A"})

5.PNG

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

7 REPLIES 7
harshnathani
Community Champion
Community Champion

Hi @nieps ,

 

You can have a look at the below videos to create and manage hierarchy

 

https://www.youtube.com/watch?v=oEOaqyaZTZw

https://www.youtube.com/watch?v=MK1jwHz8hoc

 

 

Regards,

HN

 

parry2k
Super User
Super User

@nieps you cannot merge two hierarchies but you can add more column to your existing one. not sure if this answered your question.

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

thanks for your answer, @parry2k 

I've already built my report the way you propose, but I don't really like the result (which I call "the quick and dirty solution").

 

@amitchandak  I'll have a look at the links you shared.

in the meanwhile, I'll try to show you where my problem lays

 

Solution 1: the Q&D one which I'm already using

Solution1.JPG

using this data structure as 'master data', I can create a hierarchy putting all levels and account column under Level 0

but, when creating the report (list), and you do the drill down, you'll find that in some cases you've got to drill 'empty' levels down until you get the account (eg. all lines in the table with empty fields)

 

Solution 2: 

Solution2.JPG

whit this data structure I can also create a hierarchy in powerBI, and the report looks perfect! but it's really hard to handle and mantain in a regular basis, even more if I whant this table to be updated with an automatism.

any other idea or suggestion?

thank you guys!

 

Hi @nieps 

 

Do you mean you'd like to set your original data transformed as the solution 2? Move the right column value to fill the left empty one?

You might try the power query something like this:

= Table.ReplaceValue(#"Changed Type","",each [B],Replacer.ReplaceValue,{"A"})

5.PNG

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

hi @v-diye-msft ,

your proposal looks good.

I wanna try it, but I'm not sure where to use the formula. you mean when I load the data and "transform" it via power query?

by the way, would this solution work even if I need to apply this formula to several columns?

I mean, as it is shown in the pics of my previous post, there are several levels; in fact, in my pics, there is one more level missing. (hu hu!)

Hi @nieps 

 

I wanna try it, but I'm not sure where to use the formula. you mean when I load the data and "transform" it via power query?
Yes.

 

by the way, would this solution work even if I need to apply this formula to several columns?

It works.

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

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.