Forum Discussion
jemalosa
2 years agoFrequent Visitor
Calculated column
Hello, I have tried to create a calculated column so that in that table I get values of percentage variation with respect to the previous month. As it is an example table and as you can see the mont...
- 2 years ago
Hi again,
I have found the solution:
Variacion_Precio_GAP =VAR ProductoActual = 'Licencias WS / SQL'[Producto]VAR precioanterior =CALCULATE (MAX('Licencias WS / SQL'[Precio GAP]),PREVIOUSMONTH('Licencias WS / SQL'[Fecha]),FILTER (ALL('Licencias WS / SQL'),'Licencias WS / SQL'[Producto] = ProductoActual))RETURNDIVIDE ('Licencias WS / SQL'[Precio GAP]- precioanterior, precioanterior)Regards
Anonymous
2 years agoNot applicable
Hi jemalosa
Can you provide us with a solution, so that others who are experiencing similar problems can also benefit from it.
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
jemalosa
2 years agoFrequent Visitor
Hi again,
I have found the solution:
Variacion_Precio_GAP =
VAR ProductoActual = 'Licencias WS / SQL'[Producto]
VAR precioanterior =CALCULATE (
MAX('Licencias WS / SQL'[Precio GAP]),PREVIOUSMONTH('Licencias WS / SQL'[Fecha]),
FILTER (
ALL('Licencias WS / SQL'),
'Licencias WS / SQL'[Producto] = ProductoActual
)
)
RETURN
DIVIDE ('Licencias WS / SQL'[Precio GAP]- precioanterior, precioanterior)
Regards