Forum Discussion
Vladracs
3 years agoHelper I
Divide 2 values on the same column?
Hello Expert, I am still trying to solve this problem, which I probably should have explained in a better way. Is there a way to dynamicaly calculate the variance between 2 row in a column, e...
Padycosmos
3 years agoSolution Sage
Your calculation is apparently incorrect, for example, (4-2)/2 = 100%
Please create an index column in Power query and use the following measure:
Pct change =
VAR pval=LOOKUPVALUE('Table'[Variable_Value],'Table'[Index],SELECTEDVALUE('Table'[Index])-1)
RETURN
DIVIDE(CALCULATE(sum('Table'[Variable_Value]),ALLSELECTED('Table'[Index]))-pval,pval)
Vladracs
3 years agoHelper I
Hi, I'll give it a try it looks like it's going to work.
Just the calculation is not what I want 🙂 I want to know the difference in percentage from one value to the next, 4 is 200% of 2, it's just 4/2
- Padycosmos3 years agoSolution SageYou may try thisPct change =VAR pval=LOOKUPVALUE('Table'[Variable_Value],'Table'[Index],SELECTEDVALUE('Table'[Index])-1)RETURNDIVIDE(CALCULATE(sum('Table'[Variable_Value]),ALLSELECTED('Table'[Index])),pval)