Forum Discussion
Combine Rows for Single Order in DAX
- 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]))
This is just one of 30k different orders that I need to display. I want the Sum for the two columns by based on the first column. Essentially it will take 50k lines down to the 30k indivudual orders and allow me to calculate the total qty of shipped and the remaining qty to ship. Apologies, I should have been more clear.
- tamerj13 years agoCommunity Champion
That doesn't change anything. Still don't understand why you cannot summarize the columns by sum? Or just create a simple SUM measures?
- A7T57ZZ3 years agoFrequent Visitor
You are correct, I used a simple summarize. I was overcomplicating things trying to account for other columns that contain uniuque values. Going to use MAX/MIN or COUNT to take care of that issue for my purpose. Your response is greatly appreciated!