Forum Discussion

benz-fsproduce's avatar
benz-fsproduce
Frequent Visitor
4 years ago
Solved

Employee New Hire

Hi I am trying to calculate new employee hires monthly. I have hire date, term date, and employee name. I tried a bunch of different formulas for new hires, but I cannot seem to get it. I also created a table to show all dates. I inserted my graph and my fields. I tried to create a relationship, but when I do it messes up all of my graphs on my other pages, so I'd prefer not to use relationships.

 

  • Hi, benz-fsproduce ;

    Try it.

    newemploy =
    VAR _old =
        SUMMARIZE (
            FILTER (
                ALL ( 'page' ),
                EOMONTH ( [Last Hire Date], 0 ) < EOMONTH ( MAX ( 'Date'[Date] ), 0 )
            ),
            [Employee ID]
        )
    VAR _new =
        SUMMARIZE (
            FILTER (
                ALL ( 'page' ),
                EOMONTH ( [Last Hire Date], 0 ) = EOMONTH ( MAX ( 'Date'[Date] ), 0 )
            ),
            [Employee ID]
        )
    RETURN
        COUNTROWS ( EXCEPT ( _new, _old ) )
    

    If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

    How to upload PBI in Community


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

3 Replies

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

    Hi, benz-fsproduce ;

    Try it.

    newemploy =
    VAR _old =
        SUMMARIZE (
            FILTER (
                ALL ( 'page' ),
                EOMONTH ( [Last Hire Date], 0 ) < EOMONTH ( MAX ( 'Date'[Date] ), 0 )
            ),
            [Employee ID]
        )
    VAR _new =
        SUMMARIZE (
            FILTER (
                ALL ( 'page' ),
                EOMONTH ( [Last Hire Date], 0 ) = EOMONTH ( MAX ( 'Date'[Date] ), 0 )
            ),
            [Employee ID]
        )
    RETURN
        COUNTROWS ( EXCEPT ( _new, _old ) )
    

    If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

    How to upload PBI in Community


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

    Hi, benz-fsproduce ;

    Is your problem solved? If so, kindly mark the proper reply as a solution to help others having the similar issue and close the case. If not, let me know and I'll try to help you further.


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.