Forum Discussion

yaman123's avatar
yaman123
Icon for Post Partisan rankPost Partisan
5 years ago

Promotions and Transfers

Hi,

 

I would like to know how I would be able to create a report based on employee promotions and transfers.  I have the below dataset and would like to show the employees who have had a transfer within the business for the chosen month from a date table. E.g if i choose Apr 2020, then the report should show employee D as they have moved roles (using the valid from - valid to fields) and they are still with the company as the date_of_leaving is 31/12/9999. 

 

TIA

 

EMP_NONAMEPOS_TITLEVALID_FROMVALID_TODATE_OF_EMPLOYMENTDATE_OF_LEAVING
10000Employee ADatabase Manager01/10/199131/12/999901/10/199131/12/9999
10001Employee BGen Council & Company Secretary08/11/200431/12/999908/11/200431/12/9999
10002Employee CCommercial Director02/10/200031/12/999902/10/200031/12/9999
10003Employee DBusiness Improvement & Planning Manager04/09/199227/04/202004/09/199231/12/9999
10004Employee DHead of Supply Chain28/04/202031/12/999904/09/199231/12/9999
10005Employee EHR & Administration Manager01/08/202031/12/999904/05/199331/12/9999
10006Employee EHR Business Partner04/05/199331/07/202004/05/199331/12/9999
10007Employee FData Manager20/09/197931/12/999920/09/197931/12/9999
10008Employee GData Team Administrator01/07/200510/01/202001/07/200510/01/2020
10009Employee HMembership Administrator01/11/202031/12/999930/10/200631/12/9999
10010Employee HMembership Contracts Manager30/10/200631/10/202030/10/200631/12/9999
10011Employee IIT Services Manager25/09/200731/12/999925/09/200731/12/9999
10012Employee JMembership Support Manager10/12/200731/08/201910/12/200731/12/9999
10013Employee JArea Manager01/09/201931/12/999910/12/200731/12/9999

4 Replies

  • v-kelly-msft's avatar
    v-kelly-msft
    Icon for Community Support rankCommunity Support

    Hi yaman123 ,

     

    First create 2 columns as below:

    Column_valid from = FORMAT('Table'[VALID_FROM],"MMM")&" "&YEAR('Table'[VALID_FROM])
    Column_valid to = FORMAT('Table'[VALID_TO],"MMM")&" "&YEAR('Table'[VALID_TO])

    Then create a new table as below:

    Table 2 = UNION(VALUES('Table'[Column_valid from]),VALUES('Table'[Column_valid to]))

    And a measure as below:

    _name = CALCULATE(MAX('Table'[NAME]),FILTER('Table',('Table'[Column_valid from]=SELECTEDVALUE('Table 2'[Column_valid from])||'Table'[Column_valid to]=SELECTEDVALUE('Table 2'[Column_valid from]))&&'Table'[DATE_OF_LEAVING]=DATE("9999","12","31")))

    And you will see:

    For the related .pbix file,pls see here.

     

    Best Regards,
    Kelly

    Did I answer your question? Mark my post as a solution!

    • yaman123's avatar
      yaman123
      Icon for Post Partisan rankPost Partisan

      Hi, 

       

      Thanks for that. I have a date table which is used to select a month year to show data for. I would like the transfers table to show old job and new job columns if possible so its only one line per employee for the chosen month year? How would i be able to achieve that? 

      • v-kelly-msft's avatar
        v-kelly-msft
        Icon for Community Support rankCommunity Support

        Hi yaman123 ,

         

        Not quite clear,could you pls provide an expected output?

         

        Best Regards,
        Kelly

        Did I answer your question? Mark my post as a solution!