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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Filter DatesBetween

Hey guys,

I've apparently not found a similar post and kind of been banging my head against the wall about this.

 

What am I trying to accomplish?

  • find out how many days a worker has been absent
    • being able to filter this (by week, month etc.)
    • do multiple calculations with this
    • absence score obviously affects multiple calculations
      • provisions
      • statistics on sickness etc. etc.

How have I been trying to solve this?

  • in a DimDates Table I have introduced a test for weekends and holidays (which come from external)
    • in a column "isWorkday" I have a boolean
      • gives me 1 for workday, 0 if not
    • this works so far
  • I have an absence_list given from the server (screenshots below)
    • here I have
      • start
      • end
      • user_id
  • I now tried to calculate the absent days
    • Summing up the number of "isWorkday" in the timeframe (DATESBETWEEN) "start" and "end"
    • it now gives me the correct number of absent workdays without holidays and weekends
  • apparently I am not able to filter this
    • since its month wise, I will have to be able to find out how many days a user_id has missed (example:) last month
    • if a user has been absent from (example:) 22. Januar UNTIL 6. February, this would have to be splitted

 

I hope this was not too complicated in explaination, dont know how to solve this at all anymore.

 

Screenshots:

DimDates

DimDatesTable.PNG

absence_list

absence_list.PNGabsence_list02.PNG

 

1 ACCEPTED SOLUTION
tex628
Community Champion
Community Champion

Hello,

Generally when I have date intervals of any kind I always try to expand them:
Starting tableStarting table

Add a column for the duration:
[End]-[Start][End]-[Start]

Then add a list of dates dependant on the start end and duration:

List.Dates([Start],[Duration]+1,#duration(1, 0, 0, 0))List.Dates([Start],[Duration]+1,#duration(1, 0, 0, 0))

 

Expand the list and you have a row for each day of each interval:
image.png

By taking this approach you should always get the exact number of days as each row can be individually counted! 

Hope this helps!

Br,
J


Connect on LinkedIn

View solution in original post

2 REPLIES 2
tex628
Community Champion
Community Champion

Hello,

Generally when I have date intervals of any kind I always try to expand them:
Starting tableStarting table

Add a column for the duration:
[End]-[Start][End]-[Start]

Then add a list of dates dependant on the start end and duration:

List.Dates([Start],[Duration]+1,#duration(1, 0, 0, 0))List.Dates([Start],[Duration]+1,#duration(1, 0, 0, 0))

 

Expand the list and you have a row for each day of each interval:
image.png

By taking this approach you should always get the exact number of days as each row can be individually counted! 

Hope this helps!

Br,
J


Connect on LinkedIn
Anonymous
Not applicable

Thank you very much!

 

I'll mark as solution as soon as I've tested out!

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.