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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello Power BI gurus,
Looking for help in achieving the following. Thank you akready for the support.
1. I have list of employees who post Hours on daily basis.
2. The maximum total hours per day are based on the day of the week for ex: monday to friday are 8 hr, and sat-sun 0 hr. I am creating a separate mapping table to store this value.
3. I want to compare the actual hours Vs the max hours.
The final DAX measures I am looking for is:
Count of number of days per month per person when Actual Hours > Max Hours
Count of number of days per month per person when Actual Hours < Max Hours
Also, if possible can I do conditional formatting based on these criteria?
Given data
| Date | Weekday | Person | Actual Hours |
| Monday, June 1, 2020 | Monday | P1 | 8 |
| Tuesday, June 2, 2020 | Tuesday | P1 | 9 |
| Wednesday, June 3, 2020 | Wednesday | P1 | 8 |
| Thursday, June 4, 2020 | Thursday | P1 | 8 |
| Friday, June 5, 2020 | Friday | P1 | 7 |
| Saturday, June 6, 2020 | Saturday | P1 | 0 |
| Sunday, June 7, 2020 | Sunday | P1 | 0 |
| Monday, June 8, 2020 | Monday | P1 | 6 |
| Tuesday, June 9, 2020 | Tuesday | P1 | 8 |
| Wednesday, June 10, 2020 | Wednesday | P1 | 8 |
Comparison table
| Weekday | Max Hours |
| Monday | 8 |
| Tuesday | 8 |
| Wednesday | 8 |
| Thursday | 8 |
| Friday | 7 |
| Saturday | 0 |
| Sunday | 0 |
Solved! Go to Solution.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
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!
| User | Count |
|---|---|
| 6 | |
| 5 | |
| 5 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 24 | |
| 21 | |
| 15 | |
| 12 | |
| 12 |