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! Request now

Reply
Anonymous
Not applicable

Issues with date for Absent Employee

Hi folks,

 

I am having issue where I need to mark the employee as "Absent" if there is no entry in database for the employee for particular date. e.g.  Emp 1 is not available on 11 April so it should map to Absent (Each Fri & Sat are holidays so we can ignore 9,10 and 16,17) PFA.

 

First check in entry is coming from database & I have created calendar table to get continuous dates but it is not showing the expected results. I want output as countinuos dates as attached (similar to Left outer join ) 
Help is much appreciated.

Power BIPower BI

Expected OutputExpected Output

2 REPLIES 2
ERD
Community Champion
Community Champion

Hello @Anonymous ,

From what I've seen/understood in your screenshots you can try the next actions:

1. Create a date column in your fact table in Power Query:
Click on 'First check in' date > Add column > Date > Day > Date only. Create relationship between this column and Date column in the Calendar table.
or

 

#"Inserted Date" = Table.AddColumn(#"PreviousStep", "First check in (date)", each DateTime.Date([First check in]), type date)

 

2. Create a measure in DAX:

 

Employee status = 
VAR currentDate = SELECTEDVALUE('Calendar'[Date])
VAR checkDate = COALESCE(MAXX(FILTER(T, T[First check in (date)] = currentDate), T[First check in (date)]),0)
RETURN
SWITCH(TRUE,
    WEEKDAY(currentDate,1) IN {6,7}, "Holiday",
    checkDate = 0, "Absent",
    "Present"
)

 

ERD_0-1618943845703.png

 

If this post helps, then please consider Accept it as the solution ✔️to help the other members find it more quickly.

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

Anonymous
Not applicable

Thanks ERD,
It works as expected in the list.
But when I am trying to use Present, absent in slicer (making calc column) it doesnt work.
Also not able to calculate total absent days for selected employee e.g. in March 21 - 9 absent etc 

Appreciate your thoughts on that.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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
Top Kudoed Authors