Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hi All,
I want to count a set of consecutive digits from a product field called ‘Products’[Code].
Counting how many times the current digit appears consecutively from the current position.
For example.
thanks
Solved! Go to Solution.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrGwsDA3NrYwVorViVYyNDAA00ZG5pYWFkZGSrGxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Added Column" = Table.AddColumn(Source, "cnt", each Text.Combine(List.Transform(List.Select(Table.Group(Table.FromList(Text.ToList([Column1])), "Column1", {"grp", Table.RowCount}, 0)[grp], each _>1), Text.From)))
in
#"Added Column"
Expertise = List.Accumulate( {Days as from Today}, {Skills and Knowledge}, (Current, Everyday) => Current & Day.LearnAndPractise(Everyday) ) |
A better inspiration came up during my supper.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrGwsDA3NrYwVorViVYyNDAA00ZG5pYWFkZGSrGxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Added Column" = Table.AddColumn(Source, "cnt", each Text.Combine(List.Transform(List.Select(List.Accumulate(Text.ToList([Column1]), {"", 0}, (s,c) => if c=s{0} then List.RemoveLastN(s) & {List.Last(s) + 1} else {c} & s & {1}), each try _>1 otherwise false), Text.From)))
in
#"Added Column"
Expertise = List.Accumulate( {Days as from Today}, {Skills and Knowledge}, (Current, Everyday) => Current & Day.LearnAndPractise(Everyday) ) |
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMrGwsDA3NrYwVorViVYyNDAA00ZG5pYWFkZGSrGxAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Added Column" = Table.AddColumn(Source, "cnt", each Text.Combine(List.Transform(List.Select(Table.Group(Table.FromList(Text.ToList([Column1])), "Column1", {"grp", Table.RowCount}, 0)[grp], each _>1), Text.From)))
in
#"Added Column"
Expertise = List.Accumulate( {Days as from Today}, {Skills and Knowledge}, (Current, Everyday) => Current & Day.LearnAndPractise(Everyday) ) |
User | Count |
---|---|
85 | |
80 | |
77 | |
49 | |
41 |
User | Count |
---|---|
114 | |
56 | |
51 | |
42 | |
42 |