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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
Daniel_01
New Member

Date Slicer that filters different date fields

I have a Date table, using CALENDARAUTO().

 

 

 

I need to be able to have a date slicer (between dates type) using this table that will filter 3 things:

1 - Absent days (this is a table that states every absent day the employee had, like this (example):

Employee_IDAbsence_TypeDate
345Sick Leave2023.12.01
345Sick Leave2023.12.02

 

2 - Employment start date, since I can't filter by current active employees, because I may want to see absenteeism in the past. So the max date I have put in the slicer should indicate the max Employment start date as well

3 -Employment date leave, for the same reason above. So the min date I have put in the slicer should indicate de min Employment date leave as well

(these last 2 columns are in a different table with Employee info, something like this:

Employee_IDEmp_Dt_StartEmp_Dt_Leave
3452021.03.012023.09.30
6462023.08.019999.12.31

(9999.12.31 = is still active)

 

So today I have 3 slicers like this:

Daniel_01_0-1703840917755.png

 

But I would like to have only 1 slicer, because they are just repeating themselves. Is this possible? I though about using the measure Max and Min of the date table and connect it somehow to the start and leave dates, but I am not sure how to do it.

2 ACCEPTED SOLUTIONS
Ritaf1983
Super User
Super User

Hi @Daniel_01 
Please refer to the linked video tutorials:

https://www.youtube.com/watch?v=eiDWMqgKlZI

https://www.youtube.com/watch?v=fOcgIuaJHEs&t=1s

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

Daniel_01
New Member

Meanwhile, I found a solution:

 

I created this measure:

dax_was_active = IF(AND(SUMX(EMP_TABLE, INT(EMP_TABLE[EMPLOYMENT_DATE_START]) - INT(MAXX(DAX_Dates, DAX_Dates[Date]))) <= 0, SUMX(EMP_TABLE, INT(EMP_TABLE[EMPLOYMENT_DATE_LEAVING]) - INT(MIN(DAX_Dates[Date]))) >= 0), "Yes", "No")
 
Then I put this measure on the filter for the table visual, so I can filter by the "Yes". This way my table will only show the active employees during that period, and with the relation between the dax_dates table and the absences table it shows the correct number of absences per employee.
 
This was quite simple after all, sorry for bothering you.

View solution in original post

3 REPLIES 3
Daniel_01
New Member

Meanwhile, I found a solution:

 

I created this measure:

dax_was_active = IF(AND(SUMX(EMP_TABLE, INT(EMP_TABLE[EMPLOYMENT_DATE_START]) - INT(MAXX(DAX_Dates, DAX_Dates[Date]))) <= 0, SUMX(EMP_TABLE, INT(EMP_TABLE[EMPLOYMENT_DATE_LEAVING]) - INT(MIN(DAX_Dates[Date]))) >= 0), "Yes", "No")
 
Then I put this measure on the filter for the table visual, so I can filter by the "Yes". This way my table will only show the active employees during that period, and with the relation between the dax_dates table and the absences table it shows the correct number of absences per employee.
 
This was quite simple after all, sorry for bothering you.
Ritaf1983
Super User
Super User

Hi @Daniel_01 
Please refer to the linked video tutorials:

https://www.youtube.com/watch?v=eiDWMqgKlZI

https://www.youtube.com/watch?v=fOcgIuaJHEs&t=1s

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Hi @Ritaf1983 !

 

Thank you for replying. These videos don't answer my solution, however. The goal of the videos is to find people who have entered or left in those dates.

My goal, however, is to filter who was active during that period and know their absent days.

 

For example: I filter the dates between 2023.01.01 - 2023.06.31 (1st semester) and the visual table should show me all employees who were active during that period, even if just for a day (so their start date should be before 2023.06.31, and their leave date should be after 2023.01.01) and should tell me the number of days people were absent during that same period.

 

Sorry if I wasn't clear! I hope this clears things up.

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.