cancel
Showing results for
Did you mean:
Frequent Visitor

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

Hi,

 Final ID SLA Result Report Date Count 12 Not Met 01-10-2021 1 12 Not Met 01-11-2021 2 12 Not Met 01-12-2021 3 12 Not Met 01-07-2022 1 12 Not Met 01-08-2022 2 12 Not Met 01-10-2022 1 12 Not Met 01-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

1 ACCEPTED SOLUTION
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]) ) )``````

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.

2 REPLIES 2
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]) ) )``````

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.

Super User

Announcements

#### 2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

#### Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

#### Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

#### Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.

Top Solution Authors
Top Kudoed Authors