Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
can someone help me converting my dax code to Custom column/M code in power query
Time =
Suppose the data is sorted by Rank
NewStep=Table.AddColumn(YourTable,"Time",Function.ScalarVector(Value.Type(each _),(t)=>let a=List.Buffer(YourTable[#"TableWithRank.ACTION_DATE"]) in List.Transform(List.Positions(a),each if _=0 then null else Duration.TotalMinutes(a{_}-a{_-1})))
| User | Count |
|---|---|
| 15 | |
| 6 | |
| 6 | |
| 5 | |
| 5 |