Forum Discussion
Rohit001
3 years agoHelper I
Data type error
Expression.Error: We cannot convert a value of type Record to type Number. Details: Value=[Record] Type=[Type] How to remove the error. I want to replace the NA value with a random number between...
parry2k
3 years agoSuper User
Rohit001 I think you need this:
let
ReplaceNullWithValue = (value, above, below) =>
if value = null then
if above <> null and below <> null then Number.RandomBetween(above, below)
else if above <> null then above
else if below <> null then below
else null
else
Text.From(value)
in
ReplaceNullWithValue([Value], try #"Added Index"{[Index]-1}[Value] otherwise null, try #"Added Index"{[Index]+1}[Value] otherwise null)
change #"Added Index" name with the previous step when you are adding this new custom column
👉 Learn Power BI and Fabric - subscribe to our YT channel - @PowerBIHowTo