Forum Discussion
How to link rows together in a same table?
- 6 years ago
Hi jereaallikko ,
How about create a column like so:
Floor = VAR MaxEstHours = MAXX ( FILTER ( 'Table', [Level ID] = EARLIER ( [Level ID] ) ), [Estimated Hours] ) VAR MaxWorkHours = MAXX ( FILTER ( 'Table', [Level ID] = EARLIER ( [Level ID] ) ), [Worked Hours] ) RETURN CALCULATE ( FIRSTNONBLANK ( 'Table'[Topic], 0 ), FILTER ( 'Table', 'Table'[Estimated Hours] = MaxEstHours && 'Table'[Worked Hours] = MaxWorkHours ) )Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello jereaallikko
as I can see in your dataset you have aggregated values, that would destroy your analysis. First step is to delete the aggregated rows. Then you can excract the identifier of each row, that represents the floor. For each step, at least in your dataset provided, you can find a logic. Hopefully these logics can also be applied to your origin dataset. Here a short example how to achive this
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WcvI1MNB1SixOzU3NK1GK1YlWUlBQAAsGl6QWKDhiCjmBhdzdDA0MddOL8kvzUhTScvLzi2AqITKoupHEgNpjAQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Summary = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Summary", type text}}),
DeleteAggregatedRows = Table.SelectRows
(
#"Changed Type",
each Text.Start(_[Summary],3)= " "
),
CreateFloorColumn = Table.AddColumn
(
DeleteAggregatedRows,
"Floor",
each Text.Split(_[Summary],"-"){0},
type text
),
CreateStepColumn = Table.AddColumn
(
CreateFloorColumn,
"Step",
each Text.Split(_[Summary],"-"){1},
type text
)
in
CreateStepColumn
As alternative you could also keep the aggregated rows and add a new column, were you identify them in order you could exclude them in your report
Copy paste this code to the advanced editor in a new blank query to see how the solution works.
If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too
Have fun
Jimmy