Forum Discussion
VTork
3 years agoFrequent Visitor
IF Statement, move values between cells
Hi all, I'm trying to come up with the right IF And statement for my power query, but I'm still quite new to the tool and having some troubles when trying to find the right DAX formula. Hopefully...
Anonymous
3 years agoNot applicable
Hi VTork ,
You could first create a what-if parameter to generate an order year, this can be dynamic, you are free to choose.
If your values are text containing "k", you need to extract the number in the text first.
Year = var _value=MAX('Table'[Value])
var _num=VALUE(LEFT(_value,LEN(_value)-1))
var _orderyear=SELECTEDVALUE(Parameter[Parameter])
return IF(_num<250,_orderyear+2,IF(_num>=250&&+_num<750,_orderyear+3,IF(_num>=750,_orderyear+4)))
If they are pure numbers, as long as the formula below is followed, I will not create sample data examples.
Year = var _num=SUM('Table'[Value])
var _orderyear=SELECTEDVALUE(Parameter[Parameter])
return IF(_num<250,_orderyear+2,IF(_num>=250&&+_num<750,_orderyear+3,IF(_num>=750,_orderyear+4)))
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.