Measure to count number of clients making higher payment than previous month

btreg

New Member
Joined
Feb 29, 2016
Messages
30
Here is a dummy dataset to illustrate my question:

Client_RefStart_of_Payment MonthPayment_Amount
10101/01/201820
10101/02/201820
10101/03/201825
10201/01/201815
10201/02/201825
10201/03/201810

<colgroup><col><col><col></colgroup><tbody>
</tbody>

I am wondering if it is possible to write measures that would enable me to count how many clients in one month have paid more / less / the same compared to the previous month.

The resulting pivot from the above would look as follows:

No of Clients with Payment Higher than Previous MonthNo of Clients with Payment Lower than Previous MonthNo of Clients with Payment Same as Previous Month
01/02/20181 1
01/03/20181 1

<colgroup><col><col><col><col></colgroup><tbody>
</tbody>

If anyone could advise how to write the measure for the "higher" example, this would be much appreciated.

(In this example, each client makes just one payment per month. I would also like to understand how the measure would need to be adapted if clients made several payments per month i.e. if I need to compare the sum of payments in two months).

Thank you in advance!
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Try:

ABCDEFGHI
1Client_RefStart_of_Payment MonthNo of Clients with Payment Higher than Previous MonthNo of Clients with Payment Lower than Previous MonthNo of Clients with Payment Same as Previous Month
21011/1/2018202/1/2018101
3101 2/1/2018203/1/2018110
41013/1/201825
51021/1/201815
61022/1/201825
71023/1/201810

<tbody>
</tbody>
Sheet3

Array Formulas
CellFormula
F2{=SUM(IF(IFERROR(<fo
MATCH($A$2:$A$10,$A$2:$A$10,0),-1</fo
)=ROW($A$2:$A$10)-ROW($A$2)+1,IF(SUMIFS($C$2:$C$10,$A$2:$A$10,$A$2:$A$10,$B$2:$B$10,">"&EOMONTH(E2,-2),$B$2:$B$10,"<="&EOMONTH(E2,-1))
< SUMIFS($C$2:$C$10,$A$2:$A$10,$A$2:$A$10,$B$2:$B$10,">"&EOMONTH(E2,-1),$B$2:$B$10,"<="&EOMONTH(E2,0)),1)))}
G2{=SUM(IF(IFERROR(MATCH($A$2:$A$10,$A$2:$A$10,0),-1)=ROW($A$2:$A$10)-ROW($A$2)+1,IF(SUMIFS($C$2:$C$10,$A$2:$A$10,$A$2:$A$10,$B$2:$B$10,">"&EOMONTH(E2,-2),$B$2:$B$10,"<="&EOMONTH(E2,-1))>SUMIFS($C$2:$C$10,$A$2:$A$10,$A$2:$A$10,$B$2:$B$10,">"&EOMONTH(E2,-1),$B$2:$B$10,"<="&EOMONTH(E2,0)),1)))}
H2{=SUM(IF(IFERROR(MATCH($A$2:$A$10,$A$2:$A$10,0),-1)=ROW($A$2:$A$10)-ROW($A$2)+1,IF(SUMIFS($C$2:$C$10,$A$2:$A$10,$A$2:$A$10,$B$2:$B$10,">"&EOMONTH(E2,-2),$B$2:$B$10,"<="&EOMONTH(E2,-1))=SUMIFS($C$2:$C$10,$A$2:$A$10,$A$2:$A$10,$B$2:$B$10,">"&EOMONTH(E2,-1),$B$2:$B$10,"<="&EOMONTH(E2,0)),1)))}

<tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>



I had to change the date formats for my regional settings, you shouldn't have to do that. The only difference in the 3 formulas is the operator. This should also work for multiple payments per month.
 
Upvote 0
Hi Eric, thank you for your response, though I am hoping to create DAX measures to perform the calculations as I want to be able to use these measures in Pivot Tables created with PowerPivot.
 
Upvote 0
My apologies, I didn't notice what forum this is in. Hopefully someone else will step in.
 
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,042
Members
448,940
Latest member
mdusw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top