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.
All,
I am stuck on a project I'm working on. What I am trying to do is create a custom hierarchy for items and am not sure how to model the data.
I am currently setting up my table to look like this:
Branch | Parent # | Part # | Child # | Item Description | Qty on Hand
Ultimately I need my matrix visual in Power BI to look like this:
Parent Item # , Item Description, Qty on Hand
For some reason, I can't get anything to work. I've tried creating a custom hierarchy and that doesn't work. I've tried just putting the parent #, part #, and child # columns in the 'Rows' field of a matrix, and that doesnt work either. Everything keeps looking like where the parent # looks correct, but the part # and child # attributes (item description, qty on hand) are just duplicates of the parent # (see example below). Does anyone have any advice on what I can do?
Example of what's happening:
12345 long channel 159,900
It should be showing this:
12345 long channel 159,900
Much appreciated.
This issue should be related to your custom hierarchy. Could you please share some sample data of the custom hierarchy?
Regards,
Jimmy Tao
You should be able to implement similar to https://www.daxpatterns.com/parent-child-hierarchies/
Proud to be a Super User!
This is a really good article. I read through it, and it seems to be focused on Excel. Does the solution apply to power BI as well? I'm having a difficult time implementing in Power BI. I created the PATH column, but don't know what to do after that.
Power Pivot uses DAX. Yes it applies to Power BI.
Are you reviewing the Complete Pattern? The only other bit that's not in the article, it's in the comments, is :
BrowseDepth:= ISFILTERED ( Nodes[Level1] ) + ISFILTERED ( Nodes[Level2] ) + ISFILTERED ( Nodes[Level3] )
MaxNodeDepth:=MAX ( Nodes[HierarchyDepth] )
If I recall correctly.
Then you'll make your own hierarchy to drag and drop Levels.
Proud to be a Super User!
Having trouble with the Node Keys and Parent Keys. My data set is essentially a bill of materials. I have one item that is composed of another item which is composed of another (3 levels total). These are broken down into item numbers.
I created my Path column fine, and my hierarchy depth column worked as well. But when I went to use the code to create my level columns, I used the following code and got an error. Any ideas? Thanks in advance.
My guess is you have duplicate values in [SHORT_ITEM_NUMBER]. You should have two tables; one is the structure of the hierarchy and the other is your fact table. Possibly you can share your file?
Proud to be a Super User!
Currently, I have an ITEM_DIM table, and an ITEM_FACT table. My hierarchy was created within my fact table. Should I have made it in my dimension table? My dimension table just has information like item description, etc.
Sound like in your project you'll end up with three tables: [Hierarchy Structure_DIM], [ITEM_DIM], & [ITEM_FACT].
In my implementation, as an example, I have [ORG_STRUCTURE], [EMPLOYEE], & [PAYROLL_FACT_DATA].
Proud to be a Super User!
Ah, I see. So in my ITEM_STRUCTURE table, I would just have Level 1, Level 2, and Level 3, and the other associated measures and columns used in the article, and that's it? How would I join that hierarchy table to my ITEM_DIM table and my ITEM_FACT table?
@abergman wrote:Ah, I see. So in my ITEM_STRUCTURE table, I would just have Level 1, Level 2, and Level 3, and the other associated measures and columns used in the article, and that's it?
This is how I implemented in my project. Hard to say if similar would work for you.
@abergman wrote:How would I join that hierarchy table to my ITEM_DIM table and my ITEM_FACT table?
Likely, again without knowing your details, ITEM_DIM > ITEM_STRUCTURE > ITEM_FACT.
Proud to be a Super User!
Yeah that makes sense. To give a few more details on my tables:
ITEM_DIM:
ITEM_HIERARCHY:
ITEM_FACT
So I would join my ITEM_DIM table to the HIERARCHY table on the item #. Then, I would join the HIERARCHY table to my FACT table through the same item #. Does that sound correct?
Sound about right.
Proud to be a Super User!
How do I set up the nodes key and parent key for my table?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |