Forum Discussion
cristiannt
9 years agoFrequent Visitor
Percentage from previous row
Hey! How you doing guys? I'd like to know the calculation for a measure that should have the following behaviour: It should calculate the percentage between the actual number of 'Solicitudes' an...
Vvelarde
Community Champion
9 years ago
Using your sample data you can use a calculated column:
Previo =
VAR EstadoPrev = Table1[Estado] - 1
RETURN
DIVIDE (
CALCULATE ( VALUES ( Table1[Solicitudes] ) ),
CALCULATE (
VALUES ( Table1[Solicitudes] ),
FILTER ( ALL ( Table1 ), Table1[Estado] = EstadoPrev )
)
)
Or you can use the next measure:
PrevioM =
VAR EstadoPrev =
MIN ( Table1[Estado] ) - 1
RETURN
IF (
HASONEVALUE ( Table1[Estado] ),
DIVIDE (
CALCULATE ( SUM ( Table1[Solicitudes] ) ),
CALCULATE (
SUM ( Table1[Solicitudes] ),
FILTER ( ALL ( Table1 ), Table1[Estado] = EstadoPrev )
)
)
+ 0
)