This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hello,
I've Staff Roster as shown in the below screenshot and I need to build a data model to analyze the data to get for example, how many employees was doing "R" in specific date...
Noting that I'll update the Rosters per month by adding employees' activities per day with the same below format
I've built some data models as below, but it doesn't give me the expected results
Solved! Go to Solution.
HI @Hesham121
In Power Query, highlight the Emps Table. Then highlight the Date columns, right click and the unpivot these columns. You will then have two new columns, Attribute and Value. Rename Attribute to Working Date and Value to Task. This will give you a table format that Power BI can work properly with.
Can i ask why the Public Holiday table is seperate to the Date? If there are no duplicate dates in the table, in Power query merge it with the Date table on the date and expand to show the Holiday name.
To count how many people where doing a certain task, please try the following
Tasks Amount = COUNT(Emps[Task])
Here in a Tbale or Matrix visual you could add the Task, Employee name & Date to the table and then this measure and you will get the reults needed.
if you want a calculation for a particular Task or Tasks you can do the following
R tasks = CALCULATE([Task Amount], KEEPFILTERS(Emps[Task] = "R"))
R-D-N Tasks = CALCULATE([Total Task] in {"R", "D", "N"}))
Thanks
Joe
If this post helps, then please Accept it as the solution
Thank you so much for the detailed solution, I'm new to PowerBI and it was clear for me!
HI @Hesham121
In Power Query, highlight the Emps Table. Then highlight the Date columns, right click and the unpivot these columns. You will then have two new columns, Attribute and Value. Rename Attribute to Working Date and Value to Task. This will give you a table format that Power BI can work properly with.
Can i ask why the Public Holiday table is seperate to the Date? If there are no duplicate dates in the table, in Power query merge it with the Date table on the date and expand to show the Holiday name.
To count how many people where doing a certain task, please try the following
Tasks Amount = COUNT(Emps[Task])
Here in a Tbale or Matrix visual you could add the Task, Employee name & Date to the table and then this measure and you will get the reults needed.
if you want a calculation for a particular Task or Tasks you can do the following
R tasks = CALCULATE([Task Amount], KEEPFILTERS(Emps[Task] = "R"))
R-D-N Tasks = CALCULATE([Total Task] in {"R", "D", "N"}))
Thanks
Joe
If this post helps, then please Accept it as the solution
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 6 | |
| 6 | |
| 4 |