Forum Discussion
Percentage from previous row
Thank you all for your responses!
Hey, tringuyenminh92 I'm getting the following error: "EARLIER/EARLIEST refers to an earlier row context which doesn't exist." Could you please support please?
VvelardeThis one is ok, but I have a date filter, when I apply it, the calculation is dividing by ALL Solicitudes instead of the amount of Solicitudes that actually have with that filter. Is there a way to apply this? Thank you again guys!
- cristiannt9 years agoFrequent Visitor
Thank you again mate! But with AllSelected I'm having the same result.
My formula is now this one:
Previo =
VAR EstadoPrev = CambiosEstado[ID_Estado] - 1
RETURN
DIVIDE (
CALCULATE ( ( CambiosEstado[Total_Solicitudes]) ),
CALCULATE (
CambiosEstado[Total_Solicitudes],
FILTER ( ALLSELECTED(CambiosEstado), CambiosEstado[ID_Estado] = EstadoPrev )
)
)ID_Estado 2, 3 and 4 should have 1,00 Previo, and ID_Estado 5 should have 0,44. Now this is dividing all by 32, which is the total amount of Solicitudes.
Thank you!
- Vvelarde9 years ago
Community Champion
hi cristiannt
Use This Measure:
PrevioM% = VAR EstadoPrev = MIN ( CambiosEstado[Estado] ) - 1 RETURN IF ( HASONEVALUE ( CambiosEstado[Estado] ), DIVIDE ( CALCULATE ( SUM ( CambiosEstado[Solicitudes] ) ), CALCULATE ( SUM ( CambiosEstado[Solicitudes] ), FILTER ( ALLEXCEPT ( CambiosEstado; CambiosEstado[Fecha] ), CambiosEstado[Estado] = EstadoPrev ) ) ) + 0 )- cristiannt9 years agoFrequent Visitor
Thanks Mate Vvelarde, but I'm still getting problems :( When I'm filtering by Fecha_Ingreso, this is still dividing by 32 Solicitudes
My measure right now is:
PrevioM% = VAR EstadoPrev = MIN ( CambiosEstado[ID_Estado] ) - 1 RETURN IF ( HASONEVALUE ( CambiosEstado[ID_Estado] ), DIVIDE ( CALCULATE ( DISTINCTCOUNT( CambiosEstado[ID_Solicitud] ) ), CALCULATE ( DISTINCTCOUNT( CambiosEstado[ID_Solicitud] ), FILTER ( ALLEXCEPT ( CambiosEstado, CambiosEstado[Fecha_Ingreso].[Date] ), CambiosEstado[ID_Estado] = EstadoPrev ) ) ) + 0 )I'm using a distinct count since the intention of the report is to check how many Solicitudes were passing though the Estados, so I'm forced to use this calculation.
Thank you