Forum Discussion
SethuPower
7 years agoFrequent Visitor
Increase Count on Status & Product Change
Hello All, Product and Status is the columns i have and need data in column Group as output. Group number to change when the status changes and Product changes Could you please help with the DAX q...
- 7 years ago
Zubair_Muhammad
Community Champion
7 years ago
Try this
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCs5PLFDSUXIsKCjKL0tNUYrVwSsWlJpLhFBwYk5qMQE1/iUZqUWEFFFTCNNCvCJO+RXoYQARQjYalwiGOYgQQeHHAgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Product = _t, Status = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Product", type text}, {"Status", type text}}),
#"Grouped Rows" = Table.Group(#"Changed Type", {"Product"}, {{"ALL", each _, type table }}),
#"Added Custom" = Table.AddColumn(#"Grouped Rows", "Custom", each Table.AddIndexColumn(
Table.Group([ALL], {"Status","Product"}, {{"ALL", each _, type table }},GroupKind.Local),"Index",1,1)),
#"Removed Columns" = Table.RemoveColumns(#"Added Custom",{"ALL"}),
#"Expanded Custom" = Table.ExpandTableColumn(#"Removed Columns", "Custom", {"Status", "ALL", "Index"}, {"Status", "ALL", "Index"}),
#"Expanded ALL" = Table.ExpandTableColumn(#"Expanded Custom", "ALL", {"Status"}, {"Status.1"})
in
#"Expanded ALL"Zubair_Muhammad
Community Champion
7 years ago