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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
dilumd
Solution Supplier
Solution Supplier

Continuous Attendance

Hi Everyone,

 

I have below table with employee attendance data from which I need to identify whether there is any employee who has reported to work continuously for 7 days or more. Pls help, may data look like this. Thank you inadvance !

 

EMP NoDate
19/17/2018
19/18/2018
19/19/2018
19/20/2018
19/21/2018
19/22/2018
19/23/2018
19/25/2018
19/26/2018
19/27/2018
19/28/2018
19/29/2018
19/30/2018
29/17/2018
29/19/2018
29/20/2018
29/21/2018
29/22/2018
29/23/2018
29/24/2018
29/25/2018
29/27/2018
29/28/2018
29/29/2018
29/30/2018
39/17/2018
39/19/2018
39/20/2018
39/21/2018
39/22/2018
39/24/2018
39/25/2018
39/27/2018
39/28/2018
39/29/2018
39/30/2018
49/17/2018
49/18/2018
49/19/2018
49/20/2018
49/21/2018
49/22/2018
49/23/2018
49/24/2018
49/25/2018
49/26/2018
49/27/2018
49/28/2018
49/29/2018
49/30/2018
1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@dilumd

 

Try this calculated column.

 It will identify the first day when consecutive 7 days start for each employee

You can then use it as VISUAL filter

 

Continuously_Present =
VAR mycontinuousdays = 7
RETURN
    IF (
        [Date] + mycontinuousdays
            - 1
            = CALCULATE (
                MIN ( [Date] ),
                FILTER (
                    Table1,
                    [EMP No] = EARLIER ( [EMP No] )
                        && [Index]
                            = EARLIER ( [Index] ) + mycontinuousdays
                                - 1
                )
            ),
        "Present"
    )

 cp.png

View solution in original post

3 REPLIES 3
jrajesh61
Frequent Visitor

Hi, I'm trying to solve similar problem to find the employee count who consectively worked more than 6 days. I'm using power Pivot to solve the same but I'm getting below error. My data looks similar some what similar

jrajesh61_2-1726068613651.png

 

Zubair_Muhammad
Community Champion
Community Champion

@dilumd

 

Try this calculated column.

 It will identify the first day when consecutive 7 days start for each employee

You can then use it as VISUAL filter

 

Continuously_Present =
VAR mycontinuousdays = 7
RETURN
    IF (
        [Date] + mycontinuousdays
            - 1
            = CALCULATE (
                MIN ( [Date] ),
                FILTER (
                    Table1,
                    [EMP No] = EARLIER ( [EMP No] )
                        && [Index]
                            = EARLIER ( [Index] ) + mycontinuousdays
                                - 1
                )
            ),
        "Present"
    )

 cp.png

Thank a lot @Zubair_Muhammad

 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.