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
BenCratsley
Frequent Visitor

Summing / Aggregating with Parent Child Hierarchies

Hi,

I am working with data that is structured in a parent-child relationship. Every level already has the rolled-up value (sum of the children). Therefore, I want Power Bi to display the value that is shown at every level (or sum on the same level) and not aggregate between parent and child. I do still need the parent-child relationship in PowerBi for drill through purposes. Attached is an example of how the data is structured. I have a dynamic number of levels, so ideally the solution wouldn't have a hard-coded number of levels. Any thoughts?

BenCratsley_0-1642699878991.png

 

1 ACCEPTED SOLUTION
v-janeyg-msft
Community Support
Community Support

Hi, @BenCratsley 

 

Create a measure to replace value.

Like this:

Measure = SUMX(FILTER('Table',[Item.2]<>BLANK()&&[Item.3]<>BLANK()),[Value])

vjaneygmsft_0-1643105825429.png

Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.

Best Regards,
Community Support Team _ Janey

View solution in original post

6 REPLIES 6
v-janeyg-msft
Community Support
Community Support

Hi, @BenCratsley 

 

Create a measure to replace value.

Like this:

Measure = SUMX(FILTER('Table',[Item.2]<>BLANK()&&[Item.3]<>BLANK()),[Value])

vjaneygmsft_0-1643105825429.png

Did I answer your question? Please mark my reply as solution. Thank you very much.
If not, please feel free to ask me.

Best Regards,
Community Support Team _ Janey

ALLUREAN
Solution Sage
Solution Sage

Hi, @BenCratsley 

Try using these 3 columns in your visual and expand the hierarchy button (Drill-Down)

 

Did I answer your question? Please Like and Mark my post as a solution if it solves your issue. Thanks.

Appreciate your Kudos !!!

https://allure-analytics.com/

https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA

https://www.linkedin.com/company/77757292/




Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




Thanks for your reply! So its still showing the total sum (adding the parent and the child together). The picture above shows the basic structure of the data, but the picture below is actually what is getting fed into PowerBi.  

 

BenCratsley_0-1642709364987.png

 

and this is a picture of the (wrong) graph using the dummy data above 

 

BenCratsley_1-1642709709845.png

 

 

Can you share some sample data and screenshots of how this data is loaded in power bi?

Just a guess, you can extract Level3 by its components and create new three levels without the totals




Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




BenCratsley_0-1642711650469.png

so the data come in like this and then I split by delimiter to brake it out into the levels. I don't think I can remove the totals, because sometimes the lower levels don't add up to the upper levels. (might be some missing data at the lower level, but its accurate at the rolled up level). I need a way to show the values as they are reported.

Try this example:

https://www.dropbox.com/s/ilhtour2cyfv3jm/Aggregating%20with%20Parent%20Child%20Hierarchies%28allure...

 

It is not the final solution, but you can try it

 




Did I answer your question? Mark my post as a solution!


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




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.