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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
jcastr02
Post Prodigy
Post Prodigy

Goal by Hour

I'd like to a measure calculation  so that if its the 6am and 10pm shift, the goal is # of people working X 7.5, if it's the 10am, 2pm, and 6pm block, the goal is number of people working X 10,  all other hours are # of people working X 15.  See below example and expected result for the goal.  

# Produced# of People WorkingHourGoal
546am30
7107am150
998am135
869am90
20410am40
34411am60
60412pm60
6041pm60
7842pm40
9063pm90
8854pm75
8745pm60
6666pm60
2447pm60
5568pm90
6679pm105
7510pm37.5
1 ACCEPTED SOLUTION
rsbin
Super User
Super User

@jcastr02 ,

Create a new Calculated Column using the SWITCH function:

Goal2 = SWITCH(
           TRUE(),
           OR( [Hour] = Time(6,0,0), [Hour] = Time(22,0,0 )), [# of People Working]*7.5,
          OR( [Hour] =Time(10,0,0), OR( [Hour] = Time(14,0,0), [Hour] = Time(18,0,0))), [# of People Working]*10,
          [# of People Working]*15 )

Trust this is what you are looking for.

Regards,

View solution in original post

1 REPLY 1
rsbin
Super User
Super User

@jcastr02 ,

Create a new Calculated Column using the SWITCH function:

Goal2 = SWITCH(
           TRUE(),
           OR( [Hour] = Time(6,0,0), [Hour] = Time(22,0,0 )), [# of People Working]*7.5,
          OR( [Hour] =Time(10,0,0), OR( [Hour] = Time(14,0,0), [Hour] = Time(18,0,0))), [# of People Working]*10,
          [# of People Working]*15 )

Trust this is what you are looking for.

Regards,

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.