Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi, I want to take only the value as max only if it is +2 greater than previous value.
@subho220 , Try a measure like
new value =
var _max = calculate(max(Table[Value]))
return
maxx(filter(Table, Table[Value] <_max),Table[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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
84 | |
67 | |
60 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |