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
| Employee Name | Date |
| Adam | 08/21/2024 |
| Adam | 08/22/2024 |
| Adam | 08/23/2024 |
| Adam | 08/24/2024 |
| Adam | 08/26/2024 |
| Adam | 08/27/2024 |
| Mike | 08/21/2024 |
| Mike | 08/22/2024 |
| Mike | 08/23/2024 |
| Mike | 08/26/2024 |
| Mike | 08/27/2024 |
My requirement is to calculate weekday of each employee. I am using this below code to calculate weekdays
Count of Weekdays = var weekdays = {1, 2, 3, 4, 5}
return
SUMX(
VALUES(Employee_Hrs_Dataset_TBL[Date])
, var isWeekDay = IF(WEEKDAY([Date],2) IN weekdays, 1, BLANK())
return
isWeekDay
)
but the sum of this calculation is showng 6 weekdays but total should show 11 . 6 for Adam and 5 for Mike. How can I acheive this?
Thank You,
Ajit
Hi @ajitsahoo8338 - as per given sample data, there is saturday it is getting ignored as we need to find only weekdays.
please find the below measure:
Hope this helps.
Proud to be a Super User! | |
Hello @rajendraongole1 Thank you for your response. I have used your code. But after using it my data look like this. Here I have used a visual level Date filter to show data from 20th august 2024 to 27th august 2024 and employee filter to show adam and aiden. Any idea why weekdays is showing wrong?
| Employee Name | Year | Month | Day | WEEKdAYS |
| Adam Fergen | 2024 | August | 20 | 10 |
| Adam Joslin | 2024 | August | 20 | 5 |
| Adam Fergen | 2024 | August | 21 | 6 |
| Adam Joslin | 2024 | August | 21 | 4 |
| Adam Fergen | 2024 | August | 22 | 7 |
| Adam Joslin | 2024 | August | 22 | 4 |
| Adam Fergen | 2024 | August | 23 | 5 |
| Adam Joslin | 2024 | August | 23 | 3 |
| Adam Fergen | 2024 | August | 26 | 8 |
| Adam Joslin | 2024 | August | 26 | 1 |
| Adam Fergen | 2024 | August | 27 | 6 |
| Adam Joslin | 2024 | August | 27 | 1 |
Hey @ajitsahoo8338 - Can you please check the first question with expectations what is the ask there?
"sum of this calculation is showng 6 weekdays but total should show 11 . 6 for Adam and 5 for Mike."--> due to one of the date is falling in saturday we are getting the adam 5 and mike 5
Above is expected output achieved.
Now, be clear can you please share sample data as input with expectations as checked in above information there is no name called "aiden"
Hope it helps.
Proud to be a Super User! | |
Sorry My mistake output should be 10.
Hi @ajitsahoo8338 Thanks for the confirmation, if your query resolved. please mark this as a solution
Thank you
Proud to be a Super User! | |
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
Check out the November 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 59 | |
| 43 | |
| 42 | |
| 23 | |
| 17 |
| User | Count |
|---|---|
| 190 | |
| 122 | |
| 96 | |
| 66 | |
| 47 |