Forum Discussion
hosea_chumba
Helper I
3 years agoPercentage change analysis per item
Take the example below, how do i compute the percentage change of client loan amount for each client ID from one cycle of loan to the next cycle. Client ID Cycle of loan Loan Amount X 1 ...
- 3 years ago
- 3 years ago
Hi, hosea_chumba
You can try the following methods.
Measure:Previous Amount = VAR _N1 = MAXX (FILTER (ALL ( 'Table' ), [Cycle of loan] < SELECTEDVALUE ( 'Table'[Cycle of loan] ) && [Client ID] = SELECTEDVALUE ( 'Table'[Client ID] ) ),[Cycle of loan]) Var _N2=CALCULATE (SUM ( 'Table'[Loan Amount] ), FILTER (ALL ( 'Table' ), [Client ID] = SELECTEDVALUE ( 'Table'[Client ID] ) && [Cycle of loan] = _N1)) Return IF(_N2=BLANK(),0,_N2)Measure = IF ([Previous Amount] = BLANK (),BLANK (), DIVIDE ([Previous Amount] - SUM ( 'Table'[Loan Amount] ),SUM ( 'Table'[Loan Amount] )))Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-zhangti
Community Support
3 years agoHi, hosea_chumba
You can try the following methods.
Measure:
Previous Amount =
VAR _N1 = MAXX (FILTER (ALL ( 'Table' ),
[Cycle of loan] < SELECTEDVALUE ( 'Table'[Cycle of loan] )
&& [Client ID] = SELECTEDVALUE ( 'Table'[Client ID] )
),[Cycle of loan])
Var _N2=CALCULATE (SUM ( 'Table'[Loan Amount] ),
FILTER (ALL ( 'Table' ),
[Client ID] = SELECTEDVALUE ( 'Table'[Client ID] )
&& [Cycle of loan] = _N1))
Return
IF(_N2=BLANK(),0,_N2)Measure =
IF ([Previous Amount] = BLANK (),BLANK (),
DIVIDE ([Previous Amount] - SUM ( 'Table'[Loan Amount] ),SUM ( 'Table'[Loan Amount] )))
Is this the result you expect?
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.