Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Calculate over and under booking of hours (COUNTIF, SUMIF)

Hello guys,

 

This is my data

Capture111.PNG

 

1. I want to count how many times, Total_Hours_Actual are more than 8, =8, and less than 8.

2. Then I want to calculate the values for the same in terms of hours.

 

I want this calculation to be done only for columns Date and workcenter (avoid all other columns). So, I wrote a Measure with allselected to avoid effect of ACTIVITY_TYPE( and some other columns). It worked as you can see my "Measure" named column.

Then, Measure 2 is checking if (measure>8,1,0).

 

I am stuck at this point. The aggregation/total of measure 2 is saying 1 which is obvious. I want to sum all the 1s.

Please suggest an approach. I am using MicroStrategy's approach but maybe there is other way to reach the result.

 

Thanks a lot 

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous ,

 

Measure = calculate(sum(Table[Total_Hours_Actual]),Table[Total_Hours_Actual ] >=8)

 

Measure 2= calculate(sum(Table[Total_Hours_Actual]),Table[Total_Hours_Actual ] <8)

 

to show in term of hours refer

https://radacad.com/calculate-duration-in-days-hours-minutes-and-seconds-dynamically-in-power-bi-using-dax

Anonymous
Not applicable

Sorry that won't work.

 

I want to count per day per employee 

1. Number of Times >8, = 8, <8

2. Total value of Over booking (actual hours - 😎 and under booking (8-actual hours)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors