Forum Discussion
A7T57ZZ
3 years agoFrequent Visitor
Combine Rows for Single Order in DAX
I am trying to combine rows with the same in DAX for a visual. Right now the DB is showing this as two or multiple different lines based on quantity status. The top chart shows how it looks current...
- 3 years ago
A7T57ZZ Seems like a simple Group By:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjU1MLcwBBLmhgZKOkogbGlgoBSrg1XK0Ai7nImFAYjCpc0MpCsWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"SO - Doc & Line" = _t, #"Line Item Qty" = _t, #"OBD Line Item Qty" = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"SO - Doc & Line", Int64.Type}, {"Line Item Qty", Int64.Type}, {"OBD Line Item Qty", Int64.Type}}), #"Grouped Rows" = Table.Group(#"Changed Type", {"SO - Doc & Line"}, {{"Line Item QTY", each List.Sum([Line Item Qty]), type nullable number}, {"OBD Line Item Qty", each List.Sum([OBD Line Item Qty]), type nullable number}}) in #"Grouped Rows"Or in DAX:
Table = SUMMARIZE('Table'[SO - Doc & Line],"Line Item Qty",SUM([Line Item Qty]),"OBD Line Item Qty",SUM([OBD Line Item Qty]))
Greg_Deckler
3 years agoCommunity Champion
A7T57ZZ Seems like a simple Group By:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjU1MLcwBBLmhgZKOkogbGlgoBSrg1XK0Ai7nImFAYjCpc0MpCsWAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"SO - Doc & Line" = _t, #"Line Item Qty" = _t, #"OBD Line Item Qty" = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"SO - Doc & Line", Int64.Type}, {"Line Item Qty", Int64.Type}, {"OBD Line Item Qty", Int64.Type}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"SO - Doc & Line"}, {{"Line Item QTY", each List.Sum([Line Item Qty]), type nullable number}, {"OBD Line Item Qty", each List.Sum([OBD Line Item Qty]), type nullable number}})
in
#"Grouped Rows"
Or in DAX:
Table = SUMMARIZE('Table'[SO - Doc & Line],"Line Item Qty",SUM([Line Item Qty]),"OBD Line Item Qty",SUM([OBD Line Item Qty]))
A7T57ZZ
3 years agoFrequent Visitor
Thank you! I used the DAX Summarize that I have used many times, but think I was trying to over complicate what I was trying to accomplish. I have many other columns with unique values, but will have to use a COUNT or MIN/MAX to display how I want them.