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
Anonymous
Not applicable

build Visual calendar- leave management

I have to build a dashboard for employee annual leave calendar. The calendar needs to be visual by month, showing total employees abseent on the date.   

P.s - I have tried using calendar template by MAC but unfortunately that gives continuous dates and due to large number of employees and interval between leaves, it doesnt work for me.

PFA data details.

Dataset 1 - Employee ID, start date, end date, leave category. 

Dataset 2  - Employee ID, Future Leaves available, Leave Balance.

 

Thanks,

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous , Refer if Matrix and conditional formatting can help

Matrix as Project plan Visual: https://youtu.be/R25QoiyoSVs

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

View solution in original post

v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

According your provided,refer the below:

dataset1:

vluwangmsft_0-1651114153137.png

Base  on this ,create a new date table:

DATE = CALENDAR("2022,4,1","2022,4,30")

Then use the below dax to create a new column:

COUNT = CALCULATE(DISTINCTCOUNT(Dateset1[Employee ID]),FILTER(Dateset1,Dateset1[start date]<='DATE'[Date]&&Dateset1[end date]>='DATE'[Date]))

Then you will get the below:(even with continuous dates  ,it will still work)

vluwangmsft_1-1651114213917.png

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

View solution in original post

6 REPLIES 6
v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

If you want to return employee ID ,refer the below:

new table:

Table2 = CROSSJOIN('DATE',Dateset1)

 Then create the below column:

Column = if(Table2[start date]<='TABLE2'[Date]&&Table2[end date]>='TABLE2'[Date],1,BLANK())

After filter:

vluwangmsft_0-1651717812654.png

Best Regards

Lucien

Anonymous
Not applicable

@v-luwang-msft  Cross Join isn't working. 
I need a calculated column next to 'Absent employee count' column to return 'Employee ID' on the days of leave in date calendar. 
for example, if employee if (x) is absent on 22 july(start date) - 26 july(end date), employee id (y) is absent on 24 july(start date) - 25 july(end date). I want calculate column to represent the following

Datecountemployee id (on leave)
22 july  1x
23 july  1x
24 july  2x,y
25 july  2x,y
26 july  1x

 

I have a seperate reference table (attached below) for the duration of start and end date. So, if i can use this table for the calculated column. that would do the job as well. 
Screenshot (10).png

Anonymous
Not applicable

Hi ! The reference table has the list of dates based on code recovery category. Could you please identify the steps to calculate employees count based recovery code category.

Screenshot (6).pngScreenshot (8).png

Anonymous
Not applicable

@v-luwang-msft Thanks for the solution. Could you please provide step to add calculated column that returns employee ID instead of count.
Thanks,

v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

According your provided,refer the below:

dataset1:

vluwangmsft_0-1651114153137.png

Base  on this ,create a new date table:

DATE = CALENDAR("2022,4,1","2022,4,30")

Then use the below dax to create a new column:

COUNT = CALCULATE(DISTINCTCOUNT(Dateset1[Employee ID]),FILTER(Dateset1,Dateset1[start date]<='DATE'[Date]&&Dateset1[end date]>='DATE'[Date]))

Then you will get the below:(even with continuous dates  ,it will still work)

vluwangmsft_1-1651114213917.png

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

amitchandak
Super User
Super User

@Anonymous , Refer if Matrix and conditional formatting can help

Matrix as Project plan Visual: https://youtu.be/R25QoiyoSVs

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.