Forum Discussion

kevinedora's avatar
kevinedora
Helper I
3 years ago
Solved

Max and Count

Hello,

 

I've been trying to work this recently but I can't find a way to do it. Please help.

 

I have this kind of database:

 

AccountNumberDateAge Bucket
A01/01/20230
B01/01/202330
C01/01/202360
D01/01/202390
E01/01/20230
A02/01/20230
A02/01/202330
B02/01/20230
C02/01/202390
D02/01/202330
E02/01/202330

 

And this is the result I'm trying to get (visual on power bi, A table, or matrix)

 

 Current Month     
 Buckets030 Days60 Days90 DaysTotal
Previous Month

0

 2  2
 30 Days1   1
 60 Days   11
 90 Days 1  1
 Total13 15

 

I need to count the account number based on their age bucket per current month (e.g. Feb 2023) and previous month (e.g. Jan 2023).  (e.g. Account number "B", one count on the "current" month column "0 days" and in the "previous" month row, it should be placed on the "30 days".

Also, just an added rule if the account number has multiple entries for one month, the count should be only 1 and it should capture the highest or max-age bucket. (e.g. Account number "A" on Feb, there are 2 entries the count should be for the Age bucket "30 days" for the current month, and for the previous month, it should be placed on 0 days).

 

Note: this is also historical so I might use a filter to change the month/date for checking older months' results.

 

Please advise. Thank you!

2 Replies