Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.
hi i have table called vw_Basicinfo have these columns Date Of Joining , Employee Id,Employee Status and LAST_WORKING_DATE so i need to get total employees count whose the Employee Statusis Active and LAST_WORKING_DATE is null and need it grouped monthly mean I need to sum of total employees for each month depending on Date Of Joining if filterd by any month show me the total employees tell this month
Solved! Go to Solution.
This query will group the data by year and month of the Date Of Joining column, and count the number of employees for each group. The result will be a table with columns for the year, month, and total number of employees.
If you want to filter the data by a specific month, you can add a WHERE clause to the query. For example, to filter by January 2023, you can use this query:
SELECT
YEAR([Date Of Joining]) AS [Year],
MONTH([Date Of Joining]) AS [Month],
COUNT([Employee Id]) AS [Total Employees]
FROM vw_Basicinfo
WHERE [Employee Status] = 'Active' AND LAST_WORKING_DATE IS NULL
AND [Date Of Joining] <= '2023-01-31'
GROUP BY YEAR([Date Of Joining]), MONTH([Date Of Joining])
ORDER BY [Year], [Month]
This query will return the total number of employees for each month up to and including January 2023.
Hi there! 😊
If you want to get the total count of employees whose Employee Status is Active and LAST_WORKING_DATE is null, grouped by month, you can use a SQL query like this:
SELECT
YEAR([Date Of Joining]) AS [Year],
MONTH([Date Of Joining]) AS [Month],
COUNT([Employee Id]) AS [Total Employees]
FROM vw_Basicinfo
WHERE [Employee Status] = 'Active' AND LAST_WORKING_DATE IS NULL
GROUP BY YEAR([Date Of Joining]), MONTH([Date Of Joining])
ORDER BY [Year], [Month]
This query will group the data by year and month of the Date Of Joining column, and count the number of employees for each group. The result will be a table with columns for the year, month, and total number of employees.
If you want to filter the data by a specific month, you can add a WHERE clause to the query. For example, to filter by January 2023, you can use this query:
SELECT
YEAR([Date Of Joining]) AS [Year],
MONTH([Date Of Joining]) AS [Month],
COUNT([Employee Id]) AS [Total Employees]
FROM vw_Basicinfo
WHERE [Employee Status] = 'Active' AND LAST_WORKING_DATE IS NULL
AND [Date Of Joining] <= '2023-01-31'
GROUP BY YEAR([Date Of Joining]), MONTH([Date Of Joining])
ORDER BY [Year], [Month]
This query will return the total number of employees for each month up to and including January 2023.
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
15 | |
15 | |
13 | |
11 | |
10 |