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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Calculate consecutive decreases over time?

Hi, hopefully someone can help with this? I have a table that looks like the below

Client_IDYearMonthTickets_Created
10442019Jul92
10442019Aug65
10442019Sep33
10442019Oct12
10442019Nov10
10442019Dec2

What I want to do is analyze Client_IDs who have a consecutive Tickets_Created on a month by month basis.  To do this I created a calculated column which compared the current month to the previous month

Client_IDYearMonthTickets_CreatedDifference
10442019Jul92-2
10442019Aug65-27
10442019Sep33-32
10442019Oct12-20
10442019Nov10-2
10442019Dec2-8

Now what I want is using the above, get a table that shows the top ten Client_IDs that have the most consecutive months decrease in tickets. So for example, the above Client_ID would have a consecutive decrease of 6 months. If the same Client_ID had an increase this month (compared to November) then they would no longer show on the top 10 table as this would reset the conescutive months they have decreased.

I hope this makes sense? Appreciate any help

1 REPLY 1
Anonymous
Not applicable

Hi, @Anonymous 

I have spend some time together with experts using some random sample. We found that you can make the consecutive count, but the tricky part is you have to re-count each time when there is increase in the tickets.

I am afraid that DAX do not support this kind of calculation, maybe try with power query.

This is my consecutive count formula if needed: 

 

Count concecutive decrease =
IF (
    [Differece] < 0,
    CALCULATE (
        COUNTROWS ( 'Table' ),
        FILTER ( ALLEXCEPT ( 'Table', 'Table'[Client_ID] ), [Differece] < 0 ),
        'Table'[Month] <= EARLIER ( 'Table'[Month] )
    ) + 0,
    BLANK ()
)

 


Best
Paul

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors