cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Compare daily actual values against targets that are defined based on the day of the week

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

DateWeekdayPersonActual Hours
Monday, June 1, 2020MondayP18
Tuesday, June 2, 2020TuesdayP19
Wednesday, June 3, 2020WednesdayP18
Thursday, June 4, 2020ThursdayP18
Friday, June 5, 2020FridayP17
Saturday, June 6, 2020SaturdayP10
Sunday, June 7, 2020SundayP10
Monday, June 8, 2020MondayP16
Tuesday, June 9, 2020TuesdayP18
Wednesday, June 10, 2020WednesdayP18

 

Comparison table

WeekdayMax Hours
Monday8
Tuesday8
Wednesday8
Thursday8
Friday7
Saturday0
Sunday0
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IV
Super User IV

Re: Compare daily actual values against targets that are defined based on the day of the week

Use your DimDate table to filter by month, and try

MEASURE= COUNTROWS(FILTER(GivenData, GivenData[ActualHours]>RELATED(CompTable[MaxHours])))

 


______________


Has this post solved your problem? Please mark it as a 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.


I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query. 


excelwithallison.com

View solution in original post

1 REPLY 1
Highlighted
Super User IV
Super User IV

Re: Compare daily actual values against targets that are defined based on the day of the week

Use your DimDate table to filter by month, and try

MEASURE= COUNTROWS(FILTER(GivenData, GivenData[ActualHours]>RELATED(CompTable[MaxHours])))

 


______________


Has this post solved your problem? Please mark it as a 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.


I work as a trainer and consultant for Microsoft 365, specialising in Power BI and Power Query. 


excelwithallison.com

View solution in original post

Helpful resources

Announcements

August Community Highlights

Check out a full recap of the month!

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Top Solution Authors