Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
mijoe
Microsoft Employee
Microsoft Employee

How to show static parent row data mixed with aggregated columns

I think I'm trying to do something not fully supported, but was hoping someone can help me figure out a way to do this.  Basically, I'm trying to pull in data for the parent node that's just static data from the parent node while also having a column that sums up its children.

 

I have 2 tables that look something like this:

IDTypeDescription
1ApplesRed, Fruit
2OrangesOrange, Fruit
3PearsGreen, Fruit

 

IDParentIDSubTypeNumber
391Red Delicious15
401Gala5
412Sumo9

 

What I'm trying to do is put this together in a matrix table and sum the number of each subtype but also maintain the description column of the parent.  Basically, I want to show data about the parent node while also having other columns that do aggregation.  This works if you don't expand any of the rows, but once you expand any of the top level rows, the table goes into "subtotal" mode and any top level item that doesn't have any children shows blank now.  Here's the pre-expand and post-expand example of the matrix I created:

 

Pre-expand:

TypeDescriptionSubTypeCount
ApplesRed, FruitRed Delicious20
OrangesOrange, FruitSumo9
PearsGreen, Fruit  

 

When you expand any of the rows:

TypeDescriptionSubTypeCount
ApplesRed, FruitRed Delicious20
 Red, Fruit (is there a way to only show this data for the parent node?)Red Delicious15
 Red, Fruit (is there a way to only show this data for the parent node?)Gala5
OrangesOrange, FruitSumo9
 Orange, Fruit (is there a way to only show this data for the parent node?)Sumo9
Pears(this is now blank because it doesn't have any children.  want this to keep the "Green, Fruit" description showing)  

 

Any help appreciated!

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

Hi  @mijoe ,

 

When the grouping of information in [SubType] is the same, the matrix will automatically aggregate according to the grouping, can you add a little character to distinguish it.

Here are the steps you can follow:

1. Create calculated table.

True =
var _table1=
SUMMARIZE(
    'Table2',
    'Table1'[ID],'Table2'[ParentID],
    "SubType",
    MAXX(
        FILTER(ALL(Table2),
        [ParentID]=EARLIER('Table2'[ParentID])&&
        'Table2'[ID]=
    MINX(
        FILTER(ALL(Table2),
        [ParentID]=EARLIER('Table2'[ParentID])),[ID])
        ),[SubType])&""&"all",
    "Number",
    SUMX(
        FILTER(ALL(Table2),
    'Table2'[ParentID]=EARLIER('Table2'[ParentID])),
    [Number]))
return
UNION(
    'Table2',_table1)

2. Join the relationships between tables.

vyangliumsft_0-1681870537780.png

3. The matrix Visual settings are as follows.

Row headers – options – Stepped layout – OFF

Row subtotals -- off

vyangliumsft_1-1681870537781.png

4. Result:

vyangliumsft_2-1681870586253.png

 

Best Regards,

Liu Yang

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

1 REPLY 1
v-yangliu-msft
Community Support
Community Support

Hi  @mijoe ,

 

When the grouping of information in [SubType] is the same, the matrix will automatically aggregate according to the grouping, can you add a little character to distinguish it.

Here are the steps you can follow:

1. Create calculated table.

True =
var _table1=
SUMMARIZE(
    'Table2',
    'Table1'[ID],'Table2'[ParentID],
    "SubType",
    MAXX(
        FILTER(ALL(Table2),
        [ParentID]=EARLIER('Table2'[ParentID])&&
        'Table2'[ID]=
    MINX(
        FILTER(ALL(Table2),
        [ParentID]=EARLIER('Table2'[ParentID])),[ID])
        ),[SubType])&""&"all",
    "Number",
    SUMX(
        FILTER(ALL(Table2),
    'Table2'[ParentID]=EARLIER('Table2'[ParentID])),
    [Number]))
return
UNION(
    'Table2',_table1)

2. Join the relationships between tables.

vyangliumsft_0-1681870537780.png

3. The matrix Visual settings are as follows.

Row headers – options – Stepped layout – OFF

Row subtotals -- off

vyangliumsft_1-1681870537781.png

4. Result:

vyangliumsft_2-1681870586253.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.