>> Download the sample (Power BI)
This sample takes the cross-joined data from the end of this ETL article: HR - Inventory Movements & Tenure (which explains how to produce the Employee Inventory Table dataset), and shows:
Employee Movements
Section titled “Employee Movements”(i) Employee movements: (external and internal) across a company, which can be visualised dynamically across dimensions such as Job Grade, Country, Office and Department, by both Month and Quarter.
Employee Tenure
Section titled “Employee Tenure”Also shown are:
(ii) Total Running Tenure (in years): for each employee, since joining the company, and
(iii) Total Running Tenure (in months): for each employee, since starting at a particular job grade.
A tenure measure by job grade makes it easier to see each employee’s progression within the company, and how their ‘Progression Velocity’ compares with other groups of employees. This may help to identify outliers for further investigation, and may also help with the further development of existing HR reward and remuneration policies.
Model Extensions
Section titled “Model Extensions”Possible extensions to this model could include:
- Adding ‘Freelance or Permanent’ as an extra field to distinguish between these staff types.
- Separating the calculations for Freelancers and Permanent Staff so that the Running Tenure 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.
- Providing further logic around the way Internal Movements are defined, depending on the filters selected on the page. Refer here for more information on Internal Leaves or Internal Joins.
Dashboard - Snippet
Section titled “Dashboard - Snippet”


Data Model - Snippet
Section titled “Data Model - Snippet”
Measures
Section titled “Measures”Count User ID
Section titled “Count User ID”Count User ID =COUNTA ( 'Cross Joined Staff Table'[User ID] )Head Count at End of Month
Section titled “Head Count at End of Month”Head Count at End of Month = CALCULATE ( COUNTA ( 'Cross Joined Staff Table'[User ID] ), 'Cross Joined Staff Table'[Part of HeadCount at End of Month] = "Y")Head Count at End of Quarter
Section titled “Head Count at End of Quarter”Head Count at End of Quarter =CALCULATE ( [Head Count at End of Month], FILTER ( 'Cross Joined Staff Table', 'Cross Joined Staff Table'[Start of Month] = MAX ( 'Cross Joined Staff Table'[Start of Month] ) ))Head Count at Start of Month
Section titled “Head Count at Start of Month”Head Count at Start of Month = CALCULATE ( COUNTA ( 'Cross Joined Staff Table'[User ID] ), 'Cross Joined Staff Table'[Part of HeadCount at Start of Month] = "Y")Head Count at Start of Quarter
Section titled “Head Count at Start of Quarter”Head Count at Start of Quarter =CALCULATE ( [Head Count at Start of Month], FILTER ( 'Cross Joined Staff Table', 'Cross Joined Staff Table'[Start of Month] = MIN ( 'Cross Joined Staff Table'[Start of Month] ) ))Job Grade Tenure Mnths Measure
Section titled “Job Grade Tenure Mnths Measure”Job Grade Tenure Mnths Measure =VAR JobGradeTenureMths = CALCULATE ( AVERAGE ( 'Cross Joined Staff Table'[Running Tenure Mnths - by Job Grade] ), FILTER ( 'Cross Joined Staff Table', 'Cross Joined Staff Table'[Start Date] = MAX ( 'Cross Joined Staff Table'[Start Date] ) ) )RETURN IF ( AND ( ISFILTERED ( 'Cross Joined Staff Table'[Job Grade] ), ISFILTERED ( 'Cross Joined Staff Table'[User ID] ) ), JobGradeTenureMths, SUMX ( SUMMARIZE ( 'Cross Joined Staff Table', [User ID], [Job Grade], [Start of Month], "Job Grade Tenure Month", CALCULATE ( AVERAGE ( 'Cross Joined Staff Table'[Running Tenure Mnths - by Job Grade] ), FILTER ( 'Cross Joined Staff Table', 'Cross Joined Staff Table'[Start Date] = MAX ( 'Cross Joined Staff Table'[Start Date] ) ) ) ), [Job Grade Tenure Month] ) )Job Grade Tenure Mnths Measure (Alternative)
Section titled “Job Grade Tenure Mnths Measure (Alternative)”Job Grade Tenure Mnths Measure (Alternative) =VAR JobGradeTenureMths = CALCULATE ( SUM ( 'Cross Joined Staff Table'[Days in Service] ), ALLEXCEPT ( 'Cross Joined Staff Table', 'Cross Joined Staff Table'[User ID], 'Cross Joined Staff Table'[Job Grade], 'Cross Joined Staff Table'[Start of Month] ) ) * 12 / 365.25RETURN IF ( AND ( ISFILTERED ( 'Cross Joined Staff Table'[Job Grade] ), ISFILTERED ( 'Cross Joined Staff Table'[User ID] ) ), JobGradeTenureMths, SUMX ( SUMMARIZE ( 'Cross Joined Staff Table', [User ID], [Job Grade], [Start of Month], "Job Grade Tenure Month", CALCULATE ( SUM ( 'Cross Joined Staff Table'[Days in Service] ), ALLEXCEPT ( 'Cross Joined Staff Table', 'Cross Joined Staff Table'[User ID], 'Cross Joined Staff Table'[Job Grade], 'Cross Joined Staff Table'[Start of Month] ) ) * 12 / 365.25 ), [Job Grade Tenure Month] ) )Leavers in Month (Both)
Section titled “Leavers in Month (Both)”Leavers in Month (Both) =CALCULATE ( COUNTA ( 'Cross Joined Staff Table'[User ID]), 'Cross Joined Staff Table'[Left in Month ?] = "Y")*-1Leavers in Month (External)
Section titled “Leavers in Month (External)”Leavers in Month (External) = CALCULATE ( COUNTA ( 'Cross Joined Staff Table'[User ID]), 'Cross Joined Staff Table'[Left in Month ?] = "Y", 'Cross Joined Staff Table'[External Leave] = "Y")*-1New Hires in Month (Both)
Section titled “New Hires in Month (Both)”New Hires in Month (Both) = CALCULATE ( COUNTA ( 'Cross Joined Staff Table'[User ID]), 'Cross Joined Staff Table'[Started in Month ?] = "Y")New Hires in Month (External)
Section titled “New Hires in Month (External)”New Hires in Month (External) = CALCULATE ( COUNTA ('Cross Joined Staff Table'[User ID]), 'Cross Joined Staff Table'[Started in Month ?] = "Y", 'Cross Joined Staff Table'[External Join] = "Y")Running Tenure Years Measure
Section titled “Running Tenure Years Measure”Running Tenure Years Measure =VAR TenureYrs = CALCULATE ( AVERAGE ( 'Cross Joined Staff Table'[Running Tenure Yrs] ), FILTER ( 'Cross Joined Staff Table', 'Cross Joined Staff Table'[Start Date] = MAX ( 'Cross Joined Staff Table'[Start Date] ) ) )RETURN IF ( ISFILTERED ( 'Cross Joined Staff Table'[User ID] ), TenureYrs, AVERAGEX ( SUMMARIZE ( 'Cross Joined Staff Table', [User ID], [Start of Month], "Tenure Years", CALCULATE ( AVERAGE ( 'Cross Joined Staff Table'[Running Tenure Yrs] ), FILTER ( 'Cross Joined Staff Table', 'Cross Joined Staff Table'[Start Date] = MAX ( 'Cross Joined Staff Table'[Start Date] ) ) ) ), [Tenure Years] ) )Running Tenure Years Measure (Alternative)
Section titled “Running Tenure Years Measure (Alternative)”Running Tenure Years Measure (Alternative) =VAR TenureYrs = CALCULATE ( SUM ( 'Cross Joined Staff Table'[Days in Service] ), ALLEXCEPT ( 'Cross Joined Staff Table', 'Cross Joined Staff Table'[User ID], 'Cross Joined Staff Table'[Start of Month] ) ) / 365.25RETURN IF ( ISFILTERED ( 'Cross Joined Staff Table'[User ID] ), TenureYrs, AVERAGEX ( SUMMARIZE ( 'Cross Joined Staff Table', [User ID], [Start of Month], "Tenure Years", CALCULATE ( SUM ( 'Cross Joined Staff Table'[Days in Service] ), ALLEXCEPT ( 'Cross Joined Staff Table', 'Cross Joined Staff Table'[User ID], 'Cross Joined Staff Table'[Start of Month] ) ) / 365.25 ), [Tenure Years] ) )Today = TODAY()Tables (DAX Alternative)
Section titled “Tables (DAX Alternative)”Cross Joined Staff Table (DAX)
Section titled “Cross Joined Staff Table (DAX)”Cross Joined Staff Table (DAX) =CROSSJOIN('Monthly Calendar', Inventory_Table)Calculated Columns (DAX Alternative)
Section titled “Calculated Columns (DAX Alternative)”Days in Service
Section titled “Days in Service”Days in Service =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 )End Date Fill
Section titled “End Date Fill”End Date Fill =IF ( ISBLANK ( [End Date] ), 2958100, [End Date] )External Join
Section titled “External Join”External Join =IF(([Start Date] - [Previous End Date]) > 30, "Y", "N")External Leave
Section titled “External Leave”External Leave =IF(([Next Start Date] - [End Date Fill]) > 30, "Y", "N")Internal Join
Section titled “Internal Join”Internal Join =IF([External Join] = "Y", "N", "Y")Internal Leave
Section titled “Internal Leave”Internal Leave =IF([External Leave] = "Y", "N", "Y")Left in Month ?
Section titled “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
Section titled “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
Section titled “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
Section titled “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
Section titled “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
Section titled “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
Section titled “Running Tenure Mths - by Job Grade”Running Tenure Mths - by Job Grade =CALCULATE ( SUM ( [Days in Service] ), 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 * 12Running Tenure Yrs
Section titled “Running Tenure Yrs”Running Tenure Yrs =CALCULATE ( SUM ( [Days in Service] ), ALLEXCEPT ( 'Cross Joined Staff Table (DAX)', 'Cross Joined Staff Table (DAX)'[Start of Month], 'Cross Joined Staff Table (DAX)'[User ID] )) / 365.25Started in Month ?
Section titled “Started in Month ?”Started in Month ? =IF ( AND ( [Start Date] >= [Start of Month], [Start Date] <= [End of Month] ), "Y", "N")Tenure Bracket
Section titled “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")