Forum Discussion

cocohoney's avatar
cocohoney
Frequent Visitor
1 year ago
Solved

Dynamic HR listing using date slicer

Hi,   I am currently struggling trying to set up a HR positions listing.   My entry data is the HR listing displaying for each employee, all their positions held and for each position held their ...
  • lbendlin's avatar
    1 year ago

    Your slicer needs to be fed by a disconnected Dates table, and then you need to use measures to read the slicer value and calculare data visibility accordingly.

  • DataNinja777's avatar
    1 year ago

    Hi cocohoney ,

     

    Building on lbendlin's solution to use a disconnected calendar table, let me provide additional guidance on how to implement it. To achieve your required snapshot at any point in time, your data model would look as follows:

     

    Next, you can write a DAX measure like the one below:

    Position held = 
    SUMX (
    EmployeeFact,
        IF (
    EmployeeFact[STARTING DATE POSITION] <= max('Calendar'[Date])
    && EmployeeFact[ENDING DATE POSITION] >= max('Calendar'[Date]),
            1,
            BLANK ()
        )
    )

    The output looks like this, and you can use the yyyy-mm slicer to get the snapshot for your selected date.

     

     

    I have attached an example pbix file for your reference.

     

    Best regards,