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
jvirgi
Helper III
Helper III

How to create a summary table of what get from a matrix with hierarchy

I have a dataset that looks like this where i have a hierarchy that i want to summarize by.  Each row would be a count of widgets for a given area.  All levels are not always known.  Here is some raw data.

5cceab8e-a251-4b83-8bad-5e38e321ef25.jpg

 I want to get a table that has all layers of the hierarchy in a single column with the sum'd totals in a 2nd column.  This matrix with a hierarchy essentially gives me this. 

2.JPG

But how would i get a table more like this with the Path included?  I may also have additional rows for years so that would be another column as well.   Can this be created as a whole new table from the original with transformations?

Capture.JPG

 

see below for sample pbix

https://drive.google.com/file/d/1ugFZRXvJW24WFD99xz5_R2c9huXDQ5nH/view?usp=sharing 

8 REPLIES 8
jvirgi
Helper III
Helper III

@Ashish_Mathur Thanks.  I was having a look.   How would you handle the fact that each version and subbrand could have duplicate names under different brands. (eg. there could be a 5 pack under any of the brands.)

You are welcome.  Sorry but i cannot understand your question.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur  If you dont make the charts with all levels of the hierarchy, then it would improperly aggregate the data.  For example if you removed Subbrand from this matrix, it would aggregate both the 2packs as if they were the same product.  

 

Capture.JPG

 

I wonder if to keep this relationship we need to merge the hierarchies to use for the relationships between tables.  For example make the Version table join to comment by a new column in both which would be =Brand & Subbrand & Version.  

Ashish_Mathur
Super User
Super User

Hi,

In the Query Editor, right click on the Path and Widgets columns and select "Unpivot other columns".


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur  Thanks for the reply.  It doesn't seem to give the desired table.  Heres what that gives:

 

Capture2.JPG

 

Hi,

I cannot get to your desired result because i cannot appreciate your desired data end result.  Why are you not contended with dragging the 3 level fields to the rows section of your matrix visual?  What information does that not give you?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

@Ashish_Mathur 

Here is what i'm looking to do,  maybe this explains it better.  I have 2 tables i need to combine:

  • Table of Comments related to products
  • Table of Sales for these products.

I want to be able to combine these tables of data so i can calculate a #comments / Sales for each level of the hierarchy  --- do this at a brand, subbrand and version level.   Sometimes comments dont have all the information as in the example.   

 

2 tables that i'd have:

Capture2.JPG

Desired output after combining the data:

Capture.JPG

 

Here is a new PBIX with this information

https://drive.google.com/file/d/19DB-kGhCX27q8sPuLaKeDJwpUKlvyMfl/view?usp=sharing 

Hi,

You may download my PBI file from here.

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.