HR - Inventory, Tenure, & Salary
HR - Inventory, Tenure, & Salary
This sample takes the following inventory, and salary data:…
Click to view large-sized image
HR Inventory, Tenure, & Salary Metrics
…and shows the following HR Inventory, Tenure, & Salary metrics:
- External Employee Inventory Movements, by Month & Quarter
- External & Internal Employee Inventory Movements (changes in Country, Office, or Department only), by Month & Quarter
- Running Tenure (in Years), and Running Tenure by Job Grade (in Months)
- Monthly HeadCount by Gender, and Department - as absolute figures, and percentages
- Total Salary by Gender, and Department
- Average Salary per Person, by Gender and Department
- New Hires, and Leavers: Totalv, *Male only, and Female only
- For a chosen Month: Headcount by Gender, Job Grade, Employment Status
- For a chosen Month: A Histogram of Runnning Tenure in Yrs
Measures are also filterable by: Office, Department, Job Grade, and Month.
Warning:
Public Holidays are not considered in this report. Only Weekends, which are assumed to fall on every Saturday, and Sunday.
Model Extensions
Possible extensions to this model, could include:
- Adding ‘Freelance or Permanent’ as an extra field to distinguish between amounts paid to these different staff types
- Separating the calculations for Freelancers and Permanent Staff so that the Running Tenure, Running Salary and Weighted Average Salary calculations only consider the time when a person was a Freelancer, or only when they were Permanent Staff, or both.
- Freelance records could be automatically linked and created from their agency Timesheet submissions.
- Consideration of Public Holidays for the Salary calculations
Dashboard - Snippet
Click to view large-sized image
Click to view large-sized image
Click to view large-sized image
Click to view large-sized image
Click to view large-sized image
Click to view large-sized image
Click to view large-sized image
Important:
In this report, in order to show the correct results, most tables and charts have additional Page filters applied to them too. Click the red filter bar on the side of each page, to see which filters have been applied to each table and chart.
Data Model - Snippet
Click to view large-sized image
Click to view large-sized image
Measures Headcount
Salary in Month GBP
Count User ID =
COUNTA ( 'Cross Joined Staff Table (DAX)'[User ID] )
Head Count at End of Month
Head Count at End of Month = CALCULATE (
COUNTA ( 'Cross Joined Staff Table (DAX)'[User ID] ),
'Cross Joined Staff Table (DAX)'[Part of HeadCount at End of Month] = "Y",
FILTER('Cross Joined Staff Table (DAX)', 'Cross Joined Staff Table (DAX)'[Start of Month] <= TODAY())
)
Head Count at End of Month PM
Head Count at End of Month PM =
CALCULATE([Head Count at End of Month], PREVIOUSMONTH('Cross Joined Staff Table (DAX)'[Start of Month]))
Head Count at End of Quarter
Head Count at End of Quarter =
CALCULATE (
[Head Count at End of Month],
FILTER (
'Cross Joined Staff Table (DAX)',
'Cross Joined Staff Table (DAX)'[Start of Month]
= MAX ( 'Cross Joined Staff Table (DAX)'[Start of Month] )
),
FILTER('Cross Joined Staff Table (DAX)', 'Cross Joined Staff Table (DAX)'[Start of Month] <= TODAY())
)
Head Count at Start of Month
Head Count at Start of Month = CALCULATE (
COUNTA ( 'Cross Joined Staff Table (DAX)'[User ID] ),
'Cross Joined Staff Table (DAX)'[Part of HeadCount at Start of Month] = "Y",
FILTER('Cross Joined Staff Table (DAX)', 'Cross Joined Staff Table (DAX)'[Start of Month] <= TODAY())
)
Head Count at Start of Quarter
Head Count at Start of Quarter =
CALCULATE (
[Head Count at Start of Month],
FILTER (
'Cross Joined Staff Table (DAX)',
'Cross Joined Staff Table (DAX)'[Start of Month]
= MIN ( 'Cross Joined Staff Table (DAX)'[Start of Month] )
),
FILTER('Cross Joined Staff Table (DAX)', 'Cross Joined Staff Table (DAX)'[Start of Month] <= TODAY())
)
Leavers (External) as % Starting HeadCount
Leavers (External) as % Starting HeadCount =
DIVIDE([Leavers in Month (External)], [Head Count at Start of Month], BLANK())
Leavers in Month (Both)
Leavers in Month (Both) =
CALCULATE (
COUNTA ( 'Cross Joined Staff Table (DAX)'[User ID]),
'Cross Joined Staff Table (DAX)'[Left in Month ?] = "Y",
FILTER('Cross Joined Staff Table (DAX)','Cross Joined Staff Table (DAX)'[Internal Leave - C-O-D] = "Y" || 'Cross Joined Staff Table (DAX)'[External Leave] = "Y"),
FILTER('Cross Joined Staff Table (DAX)', 'Cross Joined Staff Table (DAX)'[Start of Month] <= TODAY())
)*-1
Leavers in Month (External)
Leavers in Month (External) =
VAR Leavers =
CALCULATE (
IF(COUNTA ( 'Cross Joined Staff Table (DAX)'[User ID]) = BLANK(), 0, COUNTA ( 'Cross Joined Staff Table (DAX)'[User ID])),
'Cross Joined Staff Table (DAX)'[Left in Month ?] = "Y",
'Cross Joined Staff Table (DAX)'[External Leave] = "Y",
FILTER('Cross Joined Staff Table (DAX)', 'Cross Joined Staff Table (DAX)'[Start of Month] <= TODAY())
)*-1
RETURN
IF(MAX('Cross Joined Staff Table (DAX)'[Start of Month]) > TODAY(), BLANK(), Leavers)
Leavers in Month (External) PM
Leavers in Month (External) PM =
CALCULATE([Leavers in Month (External)], PREVIOUSMONTH('Cross Joined Staff Table (DAX)'[Start of Month]))
New Hires (External) as % Starting HeadCount
New Hires (External) as % Starting HeadCount =
DIVIDE([New Hires in Month (External)], [Head Count at Start of Month], BLANK())
New Hires in Month (Both)
New Hires in Month (Both) =
CALCULATE (
COUNTA ( 'Cross Joined Staff Table (DAX)'[User ID]),
'Cross Joined Staff Table (DAX)'[Started in Month ?] = "Y",
FILTER('Cross Joined Staff Table (DAX)','Cross Joined Staff Table (DAX)'[Internal Join - C-O-D] = "Y" || 'Cross Joined Staff Table (DAX)'[External Join] = "Y"),
FILTER('Cross Joined Staff Table (DAX)', 'Cross Joined Staff Table (DAX)'[Start of Month] <= TODAY())
)
New Hires in Month (External)
New Hires in Month (External) =
VAR NewHires =
CALCULATE (
IF(COUNTA ('Cross Joined Staff Table (DAX)'[User ID]) = BLANK(), 0, COUNTA ('Cross Joined Staff Table (DAX)'[User ID])),
'Cross Joined Staff Table (DAX)'[Started in Month ?] = "Y",
'Cross Joined Staff Table (DAX)'[External Join] = "Y",
FILTER('Cross Joined Staff Table (DAX)', 'Cross Joined Staff Table (DAX)'[Start of Month] <= TODAY())
)
RETURN
IF(MAX('Cross Joined Staff Table (DAX)'[Start of Month]) > TODAY(), BLANK(), NewHires)
New Hires in Month (External) PM
New Hires in Month (External) PM =
CALCULATE([New Hires in Month (External)], PREVIOUSMONTH('Cross Joined Staff Table (DAX)'[Start of Month]))
Today
Today = TODAY()
Measures Salary
Average Salary by Person (Actual) GBP
Average Salary by Person (Actual) GBP =
AVERAGEX (
SUMMARIZE (
'Cross Joined Staff Table (DAX)',
'Cross Joined Staff Table (DAX)'[User ID],
'Cross Joined Staff Table (DAX)'[Start of Month]
),
CALCULATE ( SUM ( 'Cross Joined Staff Table (DAX)'[Salary in Month GBP] ) )
)
Average Salary by Person (Actual) GBP PM
Average Salary by Person (Actual) GBP PM =
CALCULATE([Average Salary by Person (Actual) GBP], PREVIOUSMONTH('Cross Joined Staff Table (DAX)'[Start of Month]))
Total Salary (Actual) GBP
Total Salary (Actual) GBP =
VAR MonthlySalaryGBP =
CALCULATE ( SUM ( 'Cross Joined Staff Table (DAX)'[Salary in Month GBP] ) )
RETURN
IF ( MonthlySalaryGBP = 0, BLANK (), MonthlySalaryGBP )
Total Salary (Actual) GBP PM
Total Salary (Actual) GBP PM =
CALCULATE([Total Salary (Actual) GBP], PREVIOUSMONTH('Cross Joined Staff Table (DAX)'[Start of Month]))
Measures Tenure
Job Grade Tenure Mnths Measure
Job Grade Tenure Mnths Measure =
VAR JobGradeTenureMths =
CALCULATE (
AVERAGE ( 'Cross Joined Staff Table (DAX)'[Running Tenure Mths - by Job Grade] ),
FILTER (
'Cross Joined Staff Table (DAX)',
'Cross Joined Staff Table (DAX)'[Start Date]
= MAX ( 'Cross Joined Staff Table (DAX)'[Start Date] )
)
)
RETURN
IF (
AND (
ISFILTERED ( 'Cross Joined Staff Table (DAX)'[Job Grade] ),
ISFILTERED ( 'Cross Joined Staff Table (DAX)'[User ID] )
),
JobGradeTenureMths,
SUMX (
SUMMARIZE (
'Cross Joined Staff Table (DAX)',
[User ID],
[Job Grade],
[Start of Month],
"Job Grade Tenure Month",
CALCULATE (
AVERAGE ( 'Cross Joined Staff Table (DAX)'[Running Tenure Mths - by Job Grade] ),
FILTER (
'Cross Joined Staff Table (DAX)',
'Cross Joined Staff Table (DAX)'[Start Date]
= MAX ( 'Cross Joined Staff Table (DAX)'[Start Date] )
)
)
),
[Job Grade Tenure Month]
)
)
Job Grade Tenure Mnths Measure (Alternative)
Job Grade Tenure Mnths Measure (Alternative) =
VAR JobGradeTenureMths =
CALCULATE (
SUM ( 'Cross Joined Staff Table (DAX)'[Days in Service (incl. W/E)] ),
ALLEXCEPT (
'Cross Joined Staff Table (DAX)',
'Cross Joined Staff Table (DAX)'[User ID],
'Cross Joined Staff Table (DAX)'[Job Grade],
'Cross Joined Staff Table (DAX)'[Start of Month]
)
) * 12 / 365.25
RETURN
IF (
AND (
ISFILTERED ( 'Cross Joined Staff Table (DAX)'[Job Grade] ),
ISFILTERED ( 'Cross Joined Staff Table (DAX)'[User ID] )
),
JobGradeTenureMths,
SUMX (
SUMMARIZE (
'Cross Joined Staff Table (DAX)',
[User ID],
[Job Grade],
[Start of Month],
"Job Grade Tenure Month",
CALCULATE (
SUM ( 'Cross Joined Staff Table (DAX)'[Days in Service (incl. W/E)] ),
ALLEXCEPT (
'Cross Joined Staff Table (DAX)',
'Cross Joined Staff Table (DAX)'[User ID],
'Cross Joined Staff Table (DAX)'[Job Grade],
'Cross Joined Staff Table (DAX)'[Start of Month]
)
) * 12 / 365.25
),
[Job Grade Tenure Month]
)
)
Running Tenure Years Measure
Running Tenure Years Measure =
VAR TenureYrs =
CALCULATE (
AVERAGE ( 'Cross Joined Staff Table (DAX)'[Running Tenure Yrs] ),
FILTER (
'Cross Joined Staff Table (DAX)',
'Cross Joined Staff Table (DAX)'[Start Date]
= MAX ( 'Cross Joined Staff Table (DAX)'[Start Date] )
)
)
RETURN
IF (
ISFILTERED ( 'Cross Joined Staff Table (DAX)'[User ID] ),
TenureYrs,
AVERAGEX (
SUMMARIZE (
'Cross Joined Staff Table (DAX)',
[User ID],
[Start of Month],
"Tenure Years",
CALCULATE (
AVERAGE ( 'Cross Joined Staff Table (DAX)'[Running Tenure Yrs] ),
FILTER (
'Cross Joined Staff Table (DAX)',
'Cross Joined Staff Table (DAX)'[Start Date]
= MAX ( 'Cross Joined Staff Table (DAX)'[Start Date] )
)
)
),
[Tenure Years]
)
)
Running Tenure Years Measure (Alternative)
Running Tenure Years Measure (Alternative) =
VAR TenureYrs =
CALCULATE (
SUM ( 'Cross Joined Staff Table (DAX)'[Days in Service (incl. W/E)] ),
ALLEXCEPT (
'Cross Joined Staff Table (DAX)',
'Cross Joined Staff Table (DAX)'[User ID],
'Cross Joined Staff Table (DAX)'[Start of Month]
)
) / 365.25
RETURN
IF (
ISFILTERED ( 'Cross Joined Staff Table (DAX)'[User ID] ),
TenureYrs,
AVERAGEX (
SUMMARIZE (
'Cross Joined Staff Table (DAX)',
[User ID],
[Start of Month],
"Tenure Years",
CALCULATE (
SUM ( 'Cross Joined Staff Table (DAX)'[Days in Service (incl. W/E)] ),
ALLEXCEPT (
'Cross Joined Staff Table (DAX)',
'Cross Joined Staff Table (DAX)'[User ID],
'Cross Joined Staff Table (DAX)'[Start of Month]
)
) / 365.25
),
[Tenure Years]
)
)
Running Tenure Years PM
Running Tenure Years PM =
CALCULATE([Running Tenure Years Measure], PREVIOUSMONTH('Cross Joined Staff Table (DAX)'[Start of Month]))
Tables
Calendar
Calendar =
VAR MinDate =
MIN ( Min_Date[Min_Date] )
VAR MaxDate =
MAX ( Max_Date[Max_Date] )
RETURN
CALENDAR ( EOMONTH ( MinDate, - 1 ) + 1, EOMONTH ( MaxDate, 0 ) )
Cross Joined Staff Table (DAX)
Cross Joined Staff Table (DAX) =
CROSSJOIN('Monthly Calendar', Inventory_Table)
Calculated Columns
Weekend
Weekend =
SWITCH ( WEEKDAY ( [Date] ), 1, 1, 7, 1, 0 )
Annual Salary GBP
Annual Salary GBP =
'Cross Joined Staff Table (DAX)'[Ratio] * 'Cross Joined Staff Table (DAX)'[FTE Salary GBP]
Days in Service (excl W/E)
Days in Service (excl W/E) =
VAR StartDate = [Start Date]
VAR EndDate =
IF ( ISBLANK ( [End Date] ), TODAY (), [End Date] )
RETURN
IF (
MIN ( MIN ( TODAY (), EndDate ), [End of Month] ) < StartDate,
BLANK (),
MIN ( MIN ( TODAY (), EndDate ), [End of Month] ) - StartDate + 1 - [Weekend Days in Service]
)
Days in Service (incl. W/E)
Days in Service (incl. W/E) =
VAR StartDate = [Start Date]
VAR EndDate =
IF ( ISBLANK ( [End Date] ), TODAY (), [End Date] )
RETURN
IF (
MIN ( MIN ( TODAY (), EndDate ), [End of Month] ) < StartDate,
BLANK (),
MIN ( MIN ( TODAY (), EndDate ), [End of Month] ) - StartDate + 1
)
Days in Service in Month (excl W/E)
Days in Service in Month (excl W/E) =
VAR StartDate =
MAX ( [Start Date], [Start of Month] )
VAR EndDate =
IF ( ISBLANK ( [End Date] ), TODAY (), [End Date] )
RETURN
IF (
MIN ( MIN ( TODAY (), EndDate ), [End of Month] ) < StartDate,
BLANK (),
MIN ( MIN ( TODAY (), EndDate ), [End of Month] ) - StartDate + 1 - [Weekend Days in Service in Month]
)
End Date Fill
End Date Fill =
IF ( ISBLANK ( [End Date] ), 2958100, [End Date] )
External Join
External Join =
IF(([Start Date] - [Previous End Date]) > 30, "Y", "N")
External Leaves
External Leave =
IF(([Next Start Date] - [End Date Fill]) > 30, "Y", "N")
Internal Join - C-O-D
Internal Join - C-O-D =
VAR PreviousCountry =
CALCULATE (
MAX ( 'Cross Joined Staff Table (DAX)'[Country] ),
FILTER (
ALLEXCEPT (
'Cross Joined Staff Table (DAX)',
'Cross Joined Staff Table (DAX)'[User ID],
'Cross Joined Staff Table (DAX)'[Start of Month]
),
'Cross Joined Staff Table (DAX)'[End Date]
= EARLIER ( 'Cross Joined Staff Table (DAX)'[Previous End Date] )
)
)
VAR PreviousOffice =
CALCULATE (
MAX ( 'Cross Joined Staff Table (DAX)'[Office] ),
FILTER (
ALLEXCEPT (
'Cross Joined Staff Table (DAX)',
'Cross Joined Staff Table (DAX)'[User ID],
'Cross Joined Staff Table (DAX)'[Start of Month]
),
'Cross Joined Staff Table (DAX)'[End Date]
= EARLIER ( 'Cross Joined Staff Table (DAX)'[Previous End Date] )
)
)
VAR PreviousDepartment =
CALCULATE (
MAX ( 'Cross Joined Staff Table (DAX)'[Department] ),
FILTER (
ALLEXCEPT (
'Cross Joined Staff Table (DAX)',
'Cross Joined Staff Table (DAX)'[User ID],
'Cross Joined Staff Table (DAX)'[Start of Month]
),
'Cross Joined Staff Table (DAX)'[End Date]
= EARLIER ( 'Cross Joined Staff Table (DAX)'[Previous End Date] )
)
)
RETURN
IF (
AND (
[External Join] = "N",
[Country] <> PreviousCountry
|| [Office] <> PreviousOffice
|| [Department] <> PreviousDepartment
),
"Y",
"N"
)
Internal Leave - C-O-D
Internal Leave - C-O-D =
VAR NextCountry =
CALCULATE (
MIN ( 'Cross Joined Staff Table (DAX)'[Country] ),
FILTER (
ALLEXCEPT (
'Cross Joined Staff Table (DAX)',
'Cross Joined Staff Table (DAX)'[User ID],
'Cross Joined Staff Table (DAX)'[Start of Month]
),
'Cross Joined Staff Table (DAX)'[Start Date]
= EARLIER ( 'Cross Joined Staff Table (DAX)'[Next Start Date] )
)
)
VAR NextOffice =
CALCULATE (
MIN ( 'Cross Joined Staff Table (DAX)'[Office] ),
FILTER (
ALLEXCEPT (
'Cross Joined Staff Table (DAX)',
'Cross Joined Staff Table (DAX)'[User ID],
'Cross Joined Staff Table (DAX)'[Start of Month]
),
'Cross Joined Staff Table (DAX)'[Start Date]
= EARLIER ( 'Cross Joined Staff Table (DAX)'[Next Start Date] )
)
)
VAR NextDepartment =
CALCULATE (
MIN ( 'Cross Joined Staff Table (DAX)'[Department] ),
FILTER (
ALLEXCEPT (
'Cross Joined Staff Table (DAX)',
'Cross Joined Staff Table (DAX)'[User ID],
'Cross Joined Staff Table (DAX)'[Start of Month]
),
'Cross Joined Staff Table (DAX)'[Start Date]
= EARLIER ( 'Cross Joined Staff Table (DAX)'[Next Start Date] )
)
)
RETURN
IF (
AND (
[External Leave] = "N",
[Country] <> NextCountry
|| [Office] <> NextOffice
|| [Department] <> NextDepartment
),
"Y",
"N"
)
Left in Month ?
Left in Month ? =
IF (
AND ( [End Date Fill] >= [Start of Month], [End Date Fill] <= [End of Month] ),
"Y",
"N"
)
Next Start Date
Next Start Date =
IF (
ISBLANK (
CALCULATE (
MIN ( 'Cross Joined Staff Table (DAX)'[Start Date] ),
FILTER (
ALLEXCEPT (
'Cross Joined Staff Table (DAX)',
'Cross Joined Staff Table (DAX)'[User ID],
'Cross Joined Staff Table (DAX)'[Start of Month]
),
'Cross Joined Staff Table (DAX)'[Start Date]
> EARLIER ( 'Cross Joined Staff Table (DAX)'[Start Date] )
)
)
),
2958465,
CALCULATE (
MIN ( 'Cross Joined Staff Table (DAX)'[Start Date] ),
FILTER (
ALLEXCEPT (
'Cross Joined Staff Table (DAX)',
'Cross Joined Staff Table (DAX)'[User ID],
'Cross Joined Staff Table (DAX)'[Start of Month]
),
'Cross Joined Staff Table (DAX)'[Start Date]
> EARLIER ( 'Cross Joined Staff Table (DAX)'[Start Date] )
)
)
)
Part of HeadCount at End of Month
Part of HeadCount at End of Month =
IF (
AND ( [Start Date] <= [End of Month], [End Date Fill] > [End of Month] ),
"Y",
"N"
)
Part of HeadCount at Start of Month
Part of HeadCount at Start of Month =
IF (
AND ( [Start Date] < [Start of Month], [End Date Fill] >= [Start of Month] ),
"Y",
"N"
)
Part of HeadCount Start or End of Month
Part of HeadCount Start or End of Month =
IF (
OR (
[Part of HeadCount at Start of Month] = "Y",
[Part of HeadCount at End of Month] = "Y"
),
"Y",
"N"
)
Previous End Date
Previous End Date =
IF (
ISBLANK (
CALCULATE (
MAX ( [End Date Fill] ),
FILTER (
ALLEXCEPT (
'Cross Joined Staff Table (DAX)',
'Cross Joined Staff Table (DAX)'[User ID],
'Cross Joined Staff Table (DAX)'[Start of Month]
),
[End Date Fill] < EARLIER ( 'Cross Joined Staff Table (DAX)'[End Date Fill] )
)
)
),
0,
CALCULATE (
MAX ( [End Date Fill] ),
FILTER (
ALLEXCEPT (
'Cross Joined Staff Table (DAX)',
'Cross Joined Staff Table (DAX)'[User ID],
'Cross Joined Staff Table (DAX)'[Start of Month]
),
[End Date Fill] < EARLIER ( 'Cross Joined Staff Table (DAX)'[End Date Fill] )
)
)
)
Running Tenure Mths - by Job Grade
Running Tenure Mths - by Job Grade =
CALCULATE (
SUM ( [Days in Service (incl. W/E)] ),
ALLEXCEPT (
'Cross Joined Staff Table (DAX)',
'Cross Joined Staff Table (DAX)'[Start of Month],
'Cross Joined Staff Table (DAX)'[User ID],
'Cross Joined Staff Table (DAX)'[Job Grade]
)
) / 365.25 * 12
Running Tenure Yrs
Running Tenure Yrs =
CALCULATE (
SUM ( [Days in Service (incl. W/E)] ),
ALLEXCEPT (
'Cross Joined Staff Table (DAX)',
'Cross Joined Staff Table (DAX)'[Start of Month],
'Cross Joined Staff Table (DAX)'[User ID]
)
) / 365.25
Salary in Month GBP
Salary in Month GBP =
VAR DaysinMonth = [End of Month] - [Start of Month] + 1
VAR WeekendDaysinMonth =
CALCULATE (
SUM ( 'Calendar'[Weekend] ),
DATESBETWEEN (
'Calendar'[Date],
'Cross Joined Staff Table (DAX)'[Start of Month],
'Cross Joined Staff Table (DAX)'[End of Month]
)
)
RETURN
[Annual Salary GBP] * ( 1 / 12 )
* DIVIDE (
[Days in Service in Month (excl W/E)],
( DaysinMonth - WeekendDaysinMonth ),
0
)
Started in Month ?
Started in Month ? =
IF (
AND ( [Start Date] >= [Start of Month], [Start Date] <= [End of Month] ),
"Y",
"N"
)
Tenure Bracket
Tenure Bracket =
SWITCH (
TRUE (),
[Running Tenure Yrs] = 0, "Nil",
[Running Tenure Yrs] > 0
&& [Running Tenure Yrs] <= 0.5, "0 to 0.5 years",
[Running Tenure Yrs] > 0.5
&& [Running Tenure Yrs] <= 1, "0.5 to 1 year",
[Running Tenure Yrs] > 1
&& [Running Tenure Yrs] <= 3, "1 to 3 years",
[Running Tenure Yrs] > 3
&& [Running Tenure Yrs] <= 5, "3 to 5 years",
[Running Tenure Yrs] > 5
&& [Running Tenure Yrs] <= 8, "5 to 8 years",
[Running Tenure Yrs] > 8
&& [Running Tenure Yrs] <= 1000, "More than 8 years",
"Other"
)
Weekend Days in Service
Weekend Days in Service =
VAR StartDate = [Start Date]
VAR EndDate =
IF ( ISBLANK ( [End Date] ), TODAY (), [End Date] )
RETURN
IF (
MIN (
MIN ( TODAY (), EndDate ),
'Cross Joined Staff Table (DAX)'[End of Month]
) < StartDate,
BLANK (),
CALCULATE (
SUM ( 'Calendar'[Weekend] ),
DATESBETWEEN (
'Calendar'[Date],
StartDate,
MIN (
MIN ( TODAY (), EndDate ),
'Cross Joined Staff Table (DAX)'[End of Month]
)
)
)
)
Weekend Days in Service
Weekend Days in Service in Month =
VAR StartDate = MAX ( [Start Date], [Start of Month] )
VAR EndDate =
IF ( ISBLANK ( [End Date] ), TODAY (), [End Date] )
RETURN
IF (
MIN (
MIN ( TODAY (), EndDate ),
'Cross Joined Staff Table (DAX)'[End of Month]
) < StartDate,
BLANK(),
CALCULATE (
SUM ( 'Calendar'[Weekend] ),
DATESBETWEEN (
'Calendar'[Date],
StartDate,
MIN (
MIN ( TODAY (), EndDate ),
'Cross Joined Staff Table (DAX)'[End of Month]
)
)
)
)
Feedback
Submit and view feedback