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
henkka
Helper II
Helper II

Count of workdays missing worktime report by employee

Hi,

 

Can someone help, I need to calculate the count of days by employee where no worktime booking made in current month but can't get it right

 

Calendar table Startdatesdim[Start date]

Startdatesdim[Day of week] (day numbers from 1 to 7)

 

Employees[Employee.id]

Worktime[Employee.id]

Worktime[Start date]

1 ACCEPTED SOLUTION
Idrissshatila
Super User
Super User

Hello @henkka ,

 

check of you could use this video for your case https://youtu.be/6JA6uy3ZRBA

 

If I answered your question, please mark my post as solution so it would appeare to others, Appreciate your Kudos 👍

Follow me on Linkedin



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




View solution in original post

2 REPLIES 2
Idrissshatila
Super User
Super User

Hello @henkka ,

 

check of you could use this video for your case https://youtu.be/6JA6uy3ZRBA

 

If I answered your question, please mark my post as solution so it would appeare to others, Appreciate your Kudos 👍

Follow me on Linkedin



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




Hi and thank you for your response. Your video led me to a solution with this. Altough its not straight forward I'll mark it as a solution. Here is the DAX that I came up with, maybe there is more efficient or reasonable ways to do this same but anyways

Days missing report - this month =
VAR _IsWorkday = FILTER(StartDatesDim , StartDatesDim[Is workday] = 1 )
VAR _Daterange = FILTER(StartDatesDim , StartDatesDim[Start date] >= EOMONTH(TODAY(), -1 ) +1 || StartDatesDim[Start date] <= TODAY())
VAR _Recordexists =
IF (
    countrows (
        FILTER ( FactWorktime  ,
                FactWorktime[Employee.id] = SELECTEDVALUE FactWorktime[Employee.id] )
                &&  FactWorktime[Start date] >= EOMONTH(TODAY() , -1 ) +1
                || FactWorktime[Start date] <= TODAY()
        )
    )
    >0 , DISTINCTCOUNT FactWorktime[Start date]), 0
)
VAR _Totalworkdays =

CALCULATE (
    COUNTROWSStartDatesDim )  ,
    _Daterange ,
    _IsWorkday
    )
VAR _Employeeworkdaybookings =
SUMX (
    DISTINCT FactWorktime[Employee.id] ) ,
    CALCULATE (
        COUNTROWS FactWorktime ) ,
        MONTH FactWorktime[Start date] ) = MONTH TODAY() ) ,
        FactWorktime[Employee.id] = EARLIER FactWorktime[Employee.id] )
    )
)
VAR _MissingDays = _Employeeworkdaybookings - _Totalworkdays
VAR Result = IF ( _MissingDays = -_Totalworkdays  ,   ,  _MissingDays * -)
RETURN
Result

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.