Forum Discussion
Mickey123
1 year agoRegular Visitor
Count the changes made on fields in a order compare to previous value in the same order.
I have a requirement to get the count of the manual changes users made on the given fields.Order co , Order#, Ordertype and Line # are unique. Here is the data set. Can someone advise me on how to co...
- 1 year ago
I will suggest to use column and not a measure for this.
Tip: Best is to get in the power query than using DAX!Dax Column syntax (and not measure syntax): For some reason it is not allowing to provide the DAX here, please check below as the reply :-) - 1 year ago
Row Index By Group = ROWNUMBER( ALLSELECTED(tbl[Order Co], tbl[Order Number], tbl[Or Ty], tbl[Line Number], tbl[Item], tbl[Request Date]), ORDERBY( tbl[Item], ASC, tbl[Request Date], ASC), PARTITIONBY(tbl[Order Co], tbl[Order Number], tbl[Or Ty], tbl[Line Number])) - 1
sevenhills
Super User
1 year agoI guess you are looking for group by count for the columns.
Try this
Measure Change Count = calculate (
countrows(), allexcept(tbl, tbl[Order Co],tbl[Order Number], tbl[Or Ty], tbl[Line Number])
)
Optional Try this, if you are interested in using group by
Measure Change Count 2 =
sumx( GROUPBY(tbl, tbl[Order Co], tbl[Order Number], tbl[Or Ty], tbl[Line Number], "cnt", SUMX ( CURRENTGROUP(), 1 ) ), [cnt])
Sample output:
Mickey123
1 year agoRegular Visitor
Hey Sevenhills, Thanks, but I am looking for something different. For, e.g., in Order 1003, the req date, item, and price changed. Hence, the count calc column will have respective 1. The original order line will have zero for all the count fields. If there is no change, the count column value will be zero. I hope I did not confuse the requirement.
Thanks
Mickey123
- sevenhills1 year ago
Super User
I will suggest to use column and not a measure for this.
Tip: Best is to get in the power query than using DAX!Dax Column syntax (and not measure syntax): For some reason it is not allowing to provide the DAX here, please check below as the reply :-)- sevenhills1 year ago
Super User
Row Index By Group = ROWNUMBER( ALLSELECTED(tbl[Order Co], tbl[Order Number], tbl[Or Ty], tbl[Line Number], tbl[Item], tbl[Request Date]), ORDERBY( tbl[Item], ASC, tbl[Request Date], ASC), PARTITIONBY(tbl[Order Co], tbl[Order Number], tbl[Or Ty], tbl[Line Number])) - 1 - Mickey1231 year agoRegular Visitor
Hey, Sevenhills, Excellent. It serves the purpose. Thank you!