Forum Discussion
BM_
4 years agoFrequent Visitor
Earlier function in M code
Hi, I have a table with memberships, I want to add a column that always gives the last enddate of a subscription for a specific member. MEMBERID SubscriptionEndDate LastSubscriptionDate ...
- 4 years ago
BM_ the equivalent M is following
let src=Table.FromRows( Json.Document( Binary.Decompress( Binary.FromText( "Vcu7CQAxEAPRXhQbtJIX7lyL2f7b8Cdz+piZE0KDgqJDA9UecVzxlk59p8krfUtS+YpM/WczqhY=", BinaryEncoding.Base64 ), Compression.Deflate ) ), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [MEMBERID = _t, SubscriptionEndDate = _t] ), CT = Table.TransformColumnTypes( src, {{"MEMBERID", Int64.Type}, {"SubscriptionEndDate", type date}} ), AC = Table.AddColumn( CT, "LastSubscriptionDate", each List.Max(Table.SelectRows(CT, (q) => q[MEMBERID] = [MEMBERID])[SubscriptionEndDate]) ) in AC
visheshjain
Impactful Individual
4 years agoHi BM_ ,
Please have a look at the following video and I think it should be pretty much what you are looking for.
Hope this helps.
Thank you,
Vishesh Jain