March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello All,
I am trying to achieve a total headcount visual for the following.
I have a table with the following columns.
Name of emp, hire date, termination date, Active(y or n), Class (Production or Support/...)
The hire date started many years ago.
I want to create the following visual that will show the overall headcount by month, but only show the current year up to the current month. Here is what i want to reproduce.
Your help is appreciated.
Thanks
hi, @arcall
Here is a similar post for you refer to:
https://community.powerbi.com/t5/Desktop/Measuring-logged-workdays/m-p/613517#M292418
For your requirement, you just need to do some adjustment:
Step1:
For date table, add a tag for months up today of the current year in the complete date table.
For example:
tag = IF(YEAR('Date'[Date])=YEAR(TODAY())&&MONTH('Date'[Date])<=MONTH(TODAY()),"y","n")
Step2:
When create a crossjoin table, add this conditional "Date "[tag]="y" and Active="y"
Step3:
Then create a Total Headcount measure and then drag date and Class (from new table) in visual
Total Headcount= CALCULATE(COUNTA('Table'[Name of emp]))
Best Regards,
Lin
Hi Lin,
I am not getting the visual I am expecting.
First, I just want to clarify about the date tag. I have a date table with a relationship to the databable (Called "HR Data"). I presume the date tag is under that date table and is a column ? Is the relationship between the date and HR Data will confuse this measure ?
Here is the DAX command for tag.
In the page date filter, do I select all years ?
Here is my crossjoin table :
hi, @arcall
For the date tag, it works well on my side.
There should be something else wrong, could you please share a simple sample pbix file and expected output. for us have a test.
Best Regards,
Lin
I also used this in my measure
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
129 | |
90 | |
75 | |
57 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |