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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
ssk_1984
Helper I
Helper I

Count the Consecutive values 'not met' by group by dates

Hi,

 

Please help to add column to count the repetation of values by grouping the Date Columns.

 

Final IDSLA ResultReport DateCount
12Not Met01-10-20211
12Not Met01-11-20212
12Not Met01-12-20213
12Not Met01-07-20221
12Not Met01-08-20222
12Not Met01-10-20221
12Not Met01-11-2022

2

 

Here, Group dates by consecutively, If any blank/stop on the dates, again the group count it from 1,2,3

 

abouve data, Final 12, and not met contineously appearing Oct 2021 to Dec 2021, then values appearing as 1,2 ,3 

after no data mis from Jan to Jun, It starts from Jul 22 to Nov 2022. Then the count should starts again form 1,2 ,3,4

 

Please help 

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @ssk_1984 

 

You can try the following methods.
Column:

Previous Date = MAXX(FILTER(ALL('Table'),[Report Date]<EARLIER('Table'[Report Date])),[Report Date])
Diff = DATEDIFF([Previous Date],[Report Date],MONTH)
First day = IF([Diff]<>1,1,BLANK())
Consecutive days = 
VAR _lastdate =
    CALCULATE ( MAX ('Table'[Report Date]),
        FILTER ('Table',
            [Report Date] <= EARLIER ( 'Table'[Report Date])
                && [First day] = 1 ) )
Return
    CALCULATE (
        COUNT('Table'[Report Date]),
        FILTER ('Table',[Report Date]>= _lastdate
                && [Report Date] <= EARLIER ( 'Table'[Report Date]) ) )

vzhangti_0-1669713447200.png

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.

View solution in original post

2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @ssk_1984 

 

You can try the following methods.
Column:

Previous Date = MAXX(FILTER(ALL('Table'),[Report Date]<EARLIER('Table'[Report Date])),[Report Date])
Diff = DATEDIFF([Previous Date],[Report Date],MONTH)
First day = IF([Diff]<>1,1,BLANK())
Consecutive days = 
VAR _lastdate =
    CALCULATE ( MAX ('Table'[Report Date]),
        FILTER ('Table',
            [Report Date] <= EARLIER ( 'Table'[Report Date])
                && [First day] = 1 ) )
Return
    CALCULATE (
        COUNT('Table'[Report Date]),
        FILTER ('Table',[Report Date]>= _lastdate
                && [Report Date] <= EARLIER ( 'Table'[Report Date]) ) )

vzhangti_0-1669713447200.png

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.

amitchandak
Super User
Super User

@ssk_1984 , refer Continuous streak

Continuous streak : https://youtu.be/GdMcwvdwr0o

 

refer

Continuous Streak -https://community.powerbi.com/t5/Desktop/Need-help-in-DAX/m-p/1277302#M559393
https://community.powerbi.com/t5/Quick-Measures-Gallery/Power-BI-Continuous-Streak-One-Day-Differenc...
https://community.powerbi.com/t5/Community-Blog/Power-BI-Continuous-Streak-With-One-Day-Break/ba-p/1...

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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