Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi All,
I am facing an issue in Power BI Desktop. I have created a measure for calculating last status based on timestamp for each employee. Now I want to draw a bar chart to display count of emplyee for each status.
Here is sample data
| EmployeeId | StatusID | Datestamp |
| 1 | 1 | 2017-05-01 11:30:00 |
| 1 | 3 | 2017-05-01 11:35:00 |
| 1 | 2 | 2017-05-01 11:40:00 |
| 2 | 3 | 2017-05-01 11:30:00 |
| 2 | 2 | 2017-05-01 11:35:00 |
| 2 | 1 | 2017-05-01 11:40:00 |
| 3 | 3 | 2017-05-01 11:42:00 |
| 4 | 1 | 2017-05-01 11:42:00 |
Status Table
| StatusID | Status Name |
| 1 | Started |
| 2 | In progress |
| 3 | Completed |
I am expecting result in graph as following (count of employee is based on latest status
| Status Name | Count of Employees |
| Started | 2 |
| In progress | 1 |
| Completed | 1 |
Thanks in Advance.
Hi,
Could you please tell me if your problem is solved? You can mark the right answer to help others if it's convenient for you.
Best Regards!
Dale
Hi,
At the first glance, it's very easy. But there are many tricks. A calculated column is recommended. Here is the formula. Please have a try.
IsLatest = CALCULATE ( IF ( COUNT ( 'Sample'[Datestamp] ) = 1, 1, 0 ), FILTER ( 'Sample', 'Sample'[Datestamp] >= EARLIER ( 'Sample'[Datestamp] ) && 'Sample'[EmployeeId] = EARLIER ( 'Sample'[EmployeeId] ) ) )
Best Regards.
Dale
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!