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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
smpa01
Community Champion
Community Champion

PATH Partition by

Is there any way to build a path that is to be partitioned by an additional partition column (group by column)

 

desired result - partitioned by Q

| Q | parent | child | rowNum | path  |
| - | ------ | ----- | ------ | ------|
| 1 | 19     | 24    | 1      | 19|24 |
| 1 | 19     | 20    | 2      | 19|20 |
| 1 | 19     | 19    | 3      | 19|19 |
| 2 | 30     | 24    | 4      | 30|24 |
| 2 | 30     | 20    | 5      | 30|20 |
| 2 | 30     | 30    | 6      | 30|30 |
| 2 | 19     | 18    | 7      | 19|18 |
| 2 | 19     | 19    | 8      | 19|19 |

 

currently getting

smpa01_0-1728498558621.png

 

sample data

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUTK0BBJGJkqxOsh8A1Q+kADxjYBMYwOEegTfAJVvjOBD9Fug8YHmxQIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Q1 = _t, parent = _t, child = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Q1", Int64.Type}, {"parent", Int64.Type}, {"child", Int64.Type}}),
    #"Added Index" = Table.AddIndexColumn(#"Changed Type", "rowNum", 1, 1, Int64.Type),
    #"Renamed Columns" = Table.RenameColumns(#"Added Index",{{"Q1", "Q"}})
in
    #"Renamed Columns"

 

@AlexisOlson 

 

Thank you in advance.

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
1 ACCEPTED SOLUTION

For a data like this, a path can be simply built out by doing this

 

smpa01_0-1728580449999.png

 

and other path callbacks work perfectly on that "built-out path". I did think it would be so simple. Not sure, if this is going to create any issues later, but for now I am working with this.

 

smpa01_1-1728580484296.png

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

View solution in original post

6 REPLIES 6
AlexisOlson
Super User
Super User

It doesn't appear that PATH can operate on a subtable, so a workaround is to concatenate Q with parent and child to create a unique identifier for each child. You can then create a path on this concatenation and then undo the concatenation if you wish.

AlexisOlson_0-1728574327035.png

For a data like this, a path can be simply built out by doing this

 

smpa01_0-1728580449999.png

 

and other path callbacks work perfectly on that "built-out path". I did think it would be so simple. Not sure, if this is going to create any issues later, but for now I am working with this.

 

smpa01_1-1728580484296.png

 

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs
Anonymous
Not applicable

Hi @smpa01 ,

It's been a while since I heard back from you and I wanted to follow up. Have you had a chance to try the solutions that have been offered? If the issue has been resolved, can you mark the post as resolved? If you're still experiencing challenges, please feel free to let us know and we'll be happy to continue to help!
Looking forward to your reply!

If you only have two levels, then you really don't need the fancy PATH functions. They're more needed for arbitrarily many levels of a ragged hierarchy. 

lbendlin
Super User
Super User

To use multi parent hierarchies you need to disambiguate/clone the children.  Child 20 needs to be split into 20.1 and 20.2

 

cf.  Parent-Child Hierarchies with multiple parents in Power BI with Power Query (thebiccountant.com)

smpa01
Community Champion
Community Champion

I am not looking for a power query solution, as long as, each parent-child pair has a corresponding partition by column as it is in my case, a simple dax concatenation of parent, child with '|' would create the path, where all the related path callbacks apply

Did I answer your question? Mark my post as a solution!
Proud to be a Super User!
My custom visualization projects
Plotting Live Sound: Viz1
Beautiful News:Viz1, Viz2, Viz3
Visual Capitalist: Working Hrs

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.