Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi, I want to take only the value as max only if it is +2 greater than previous value.
Hi @subho220
Why is 3 the answer? 3 is not +2 greater than 2?
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.
Proud to be a Super User!
hi ,
So what I actually want is -
if you compare all the columns with offset +2 for max 1 compare 2, will be 1 since 2 is not +2 times greater then 1 since 2 didn't take the max value we will still have 1 as the Max 1 compares 3 will be 3 since 3 is +2 times greater then 1 since 3 is the max now next comparison will be done with 3, 3 compare 4 will be 3 since 4 is not +2 greater then 3
Hi @subho220
Try this
let
NumberList = {1,2,3,4},
res = List.Accumulate
(
NumberList,
NumberList{0},
(state, current) =>
if current > (state + 1) then current else state
)
in
res
or using some data in a column
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlSK1YlWMgKTxmDSRCk2FgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Numbers = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Numbers", Int64.Type}}),
res = List.Accumulate
(
#"Changed Type"[Numbers],
#"Changed Type"[Numbers]{0},
(state, current) =>
if current > (state + 1) then current else state
)
in
res
Phil
If I answered your question please mark my post as the solution.
If my answer helped solve your problem, give it a kudos by clicking on the Thumbs Up.
Proud to be a Super User!
Can it be done in measure?
Hi, @subho220
Not sure about the calculation logic.
For the following data ,your requirement is to get 7,right ?
| Original Data | Max Result | |
| 2 | 2 | |
| 3 | 2 | |
| 5 | 5 | |
| 6 | 5 | |
| 4 | 5 | |
| 7 | 7 | |
| 8 | 7 |
Best Regards,
Community Support Team _ Eason
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.