Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mikekim123
Frequent Visitor

How to show Head Count employee names newly added on a monthly basis?

I am working on a HC Report and i am displaying HC count per month as you can see in Attached Image.

For Regular employess from Nov to december there is an increease of 2 employees (77 - 79).

Write now i made a drillthrough on employee count so that when the user drillthrough from november he sees 77 employee name and when he drill through from december he is seeing 79 Employee names.

 i want to show the 2  new employee name, when either the user hover over december or user drillthrough on december(79).

I am struggling with the dax Measure to show the change in employee number . Could Someone help me with the measure?
This is the measure written for HC count
Employee Count =
var EmpCount = CALCULATE (
SUM ( 'HC DATA'[Count] ),
'HC DATA'[Period] = MAX ( 'HC DATA'[Period] )
)

I am struggling with the dax Measure to show the change in employee number . Could Someone help me with the measure?
HC addon.png


1 ACCEPTED SOLUTION
v-yueyunzh-msft
Community Support
Community Support

Hi , @mikekim123 

According to your requirements description, you want to implement in the matrix the difference between the current month's employee count and the previous month's employee count under the grouping of 'Emplopyee' [D/E/F Parent MU] to get the number of new employees, and you want to write a measure implementation through DAX expressions, right?

Based on my tests, you can refer to my solution ideas:

Here is my test data:

vyueyunzhmsft_0-1678851201062.png

You can create such a measure:

Count difference =

var _lastmonthcount=CALCULATE(COUNT(Emplopyee[Emplopyee name]),FILTER(ALL('Emplopyee'),'Emplopyee'[Date]>EOMONTH(MIN('Emplopyee'[Date]),-2)&&'Emplopyee'[Date]<EOMONTH(MIN('Emplopyee'[Date])&&'Emplopyee'[D/E/F Parent MU]=MAX('Emplopyee'[D/E/F Parent MU]),-1)+1))

return

COUNT(Emplopyee[Emplopyee name])-_lastmonthcount

Then add the measure to the corresponding visual to check if it meets your requirements:

vyueyunzhmsft_1-1678851244109.png

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

1 REPLY 1
v-yueyunzh-msft
Community Support
Community Support

Hi , @mikekim123 

According to your requirements description, you want to implement in the matrix the difference between the current month's employee count and the previous month's employee count under the grouping of 'Emplopyee' [D/E/F Parent MU] to get the number of new employees, and you want to write a measure implementation through DAX expressions, right?

Based on my tests, you can refer to my solution ideas:

Here is my test data:

vyueyunzhmsft_0-1678851201062.png

You can create such a measure:

Count difference =

var _lastmonthcount=CALCULATE(COUNT(Emplopyee[Emplopyee name]),FILTER(ALL('Emplopyee'),'Emplopyee'[Date]>EOMONTH(MIN('Emplopyee'[Date]),-2)&&'Emplopyee'[Date]<EOMONTH(MIN('Emplopyee'[Date])&&'Emplopyee'[D/E/F Parent MU]=MAX('Emplopyee'[D/E/F Parent MU]),-1)+1))

return

COUNT(Emplopyee[Emplopyee name])-_lastmonthcount

Then add the measure to the corresponding visual to check if it meets your requirements:

vyueyunzhmsft_1-1678851244109.png

Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

 

Best Regards,

Aniya Zhang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.