Power bi Calculate the Monday dates

K_Stevs1

New Member
Joined
Jan 27, 2022
Messages
27
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Hi Is there a way in power bi to calculate the Monday's covered between two dates, if annual leave or sickness cover more than 1 week? I have also asked if it is possible in Excel, but then Power Bi, came to mind as well.

Thanks for any advice.

Demo.xlsx
ABCDEFGHIJK
1Absence CategoryAbsence Start DateAbsence End DateMonday DateTotal Duration (Days)Total Absence Duration (Hours)Total Absence Duration (Days)FTEWTEHoursFirst Day Absent
2Annual Leave06/05/2024 00:0002/06/2024 00:0006/05/202428150.00281.0037.507.50Mon
3Annual Leave15/04/2024 00:0012/05/2024 00:0015/04/202428120.00280.8037.507.50Mon
4Annual Leave01/02/2024 00:0028/02/2024 00:0029/01/20242892.00280.6137.507.50Thu
5Sickness25/12/2023 00:0021/01/2024 00:0025/12/2023289.20280.8023.004.60Mon
6Sickness15/07/2024 00:0011/08/2024 00:0015/07/2024289.20281.0023.004.60Mon
7Sickness15/07/2024 00:0011/08/2024 00:0015/07/2024289.20281.0023.004.60Mon
8Annual Leave22/07/2024 00:0018/08/2024 00:0022/07/202428150.00281.0034.506.90Mon
Sheet1
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
One way in Excel.
Book1
ABCDEFGHIJKL
1Absence CategoryAbsence Start DateAbsence End DateMonday DateTotal Duration (Days)Total Absence Duration (Hours)Total Absence Duration (Days)FTEWTEHoursFirst Day Absent# Mondays
2Annual Leave6/05/2024 0:002/06/2024 0:006/05/202428150.00281.0037.507.50Mon4
3Annual Leave15/04/2024 0:0012/05/2024 0:0015/04/202428120.00280.8037.507.50Mon4
4Annual Leave1/02/2024 0:0028/02/2024 0:0029/01/20242892.00280.6137.507.50Thu4
5Sickness25/12/2023 0:0021/01/2024 0:0025/12/2023289.20280.8023.004.60Mon4
6Sickness15/07/2024 0:0011/08/2024 0:0015/07/2024289.20281.0023.004.60Mon4
7Sickness15/07/2024 0:0011/08/2024 0:0015/07/2024289.20281.0023.004.60Mon4
8Annual Leave22/07/2024 0:0018/08/2024 0:0022/07/202428150.00281.0034.506.90Mon4
Sheet1
Cell Formulas
RangeFormula
L2:L8L2=IF((C2-B2)>7,SUM((WEEKDAY(SEQUENCE(C2-B2,,B2,1),2)=1)/1),0)


With PowerBI you probably need a date table. Is it available in your data model?

Or maybe this can help= Creating a List of Numbers or Dates in Power BI using GenerateSeries Function in DAX
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,109
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top