Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I have:
I want:
So far, I've done the heavy lifting for this chart in Excel, and imported the Excel result into Power BI. This is cumbersome, especially since Excel doesn't do stepped charts at all, so I had to do some previous date tricks to get it working at all.
I suspect there's an easier way to do it in Power BI, but I'm not sure how. Use the Calendar dates as input for a measure in the People table, which compares to the contract dates to determine whether the record should be counted? Chart that measure somehow? I'm still getting my head around measures in general, so any help is greatly appreciated!
Solved! Go to Solution.
Hi @FlorisMK ,
In order to deal with the headcount issue using dax, the best practice is to use the following tables which you have specified in your message:
and then set these tables as disconnected tables and write a measure like below:
Headcount =
SUMX (
EmployeeFact,
IF (
EmployeeFact[Start] <= [SelectedDate]
&& EmployeeFact[End] >= [SelectedDate],
1,
BLANK ()
)
)
For the details of how to set up the data model, please refer to the article below:
Dynamic Headcount Analysis using Dax - Microsoft Fabric Community
Best regards,
@DataNinja777 That's great, thanks! The article you link to has a wealth of information on wha I need.
Hi @FlorisMK ,
In order to deal with the headcount issue using dax, the best practice is to use the following tables which you have specified in your message:
and then set these tables as disconnected tables and write a measure like below:
Headcount =
SUMX (
EmployeeFact,
IF (
EmployeeFact[Start] <= [SelectedDate]
&& EmployeeFact[End] >= [SelectedDate],
1,
BLANK ()
)
)
For the details of how to set up the data model, please refer to the article below:
Dynamic Headcount Analysis using Dax - Microsoft Fabric Community
Best regards,
User | Count |
---|---|
84 | |
79 | |
71 | |
48 | |
43 |
User | Count |
---|---|
111 | |
54 | |
50 | |
40 | |
40 |