March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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 | 200 |
X | 2 | 450 |
R | 1 | 20,000 |
R | 2 | 4,500 |
R | 3 | 34,000 |
Solved! Go to Solution.
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.
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
21 | |
14 | |
11 | |
6 | |
5 |
User | Count |
---|---|
27 | |
23 | |
20 | |
13 | |
10 |