Forum Discussion

Mickey123's avatar
Mickey123
Regular Visitor
1 year ago
Solved

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 code to get these values?

Order CoOrder NumberOr TyLine NumberRequest DateItemPriceUser IDDate Change countPart changePrice change 
1001003SN14/4/2024A20410JACK000 
1001003SN14/10/2024A20512PDAVIS111 
1001004SN14/4/2024A14515JACK000 
1001004SN14/12/2024A14515AMLY100 
1001005SN14/30/2024A99980JACK000 
1001005SN14/30/2024A99980AMLY000 
1001005SN24/30/2024A99792JACK000 
1001005SN25/12/2024A99895AMLY111 
  • 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 :-)
     
     
     
  • sevenhills's avatar
    sevenhills
    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