Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
kevinedora
Helper I
Helper I

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!

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Here is a Power Query option based on your sample data. Please provide sample data that fully covers your scenario.

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

Here is a Power Query option based on your sample data. Please provide sample data that fully covers your scenario.

This already works on my end. Thank you!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.