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

Problem with Calculating OEE values per production shift

Hi,

 

I am making a dashboard to represent OEE values from online values. I need to break it down to different shifts.

I dont have any problems with the morning and evening shift, but the night shift gives a blank value (which i changed with the ISBLANK formula to zero). While checking it in Excel a value is given.

 

vrmntmtt_1-1635433804698.png

 

I have the following columns:

vrmntmtt_0-1635433710187.png

 

Splitting the Received_at column into a "only time" column helps the calculation for the morning and evening shift.

 

I used the following measure for the morning shift:

%_good_products_Early_shift = CALCULATE([%_good_products],'4xCounter5'[received_at_only_time<=TIMEVALUE("14:00:00"),'4xCounter5'[received_at_only_time]>TIMEVALUE("06:00:00"))

 

I used the same formula for the evening shift, but then with timevalues <= "22:00:00" and > "06:00:00"

 

But for some reason this wont work for the night shift.

%_good_products_Night_shift = CALCULATE([%_good_products],'4xCounter5'[received_at_only_time]<=TIMEVALUE("06:00:00"),'4xCounter5'[received_at_only_time]>TIMEVALUE("22:00:00"))
 
Thank you in advance for your help.
 
With kind regards,
Matthias

 

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@vrmntmtt 

It's because no time is both > 22:00:00 and <= 06:00:00 because that is 6 AM the next day.  You will need to split it into 2 compares.

%_good_products_Night_shift =
CALCULATE (
    [%_good_products],
	'4xCounter5'[received_at_only_time] > TIMEVALUE ( "22:00:00" ) && '4xCounter5'[received_at_only_time] <= TIMEVALUE ( "23:59:59" ) || 
	'4xCounter5'[received_at_only_time] >= TIMEVALUE ( "00:00:00" ) && '4xCounter5'[received_at_only_time] <= TIMEVALUE ( "06:00:00" ) 
)

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

@vrmntmtt 

It's because no time is both > 22:00:00 and <= 06:00:00 because that is 6 AM the next day.  You will need to split it into 2 compares.

%_good_products_Night_shift =
CALCULATE (
    [%_good_products],
	'4xCounter5'[received_at_only_time] > TIMEVALUE ( "22:00:00" ) && '4xCounter5'[received_at_only_time] <= TIMEVALUE ( "23:59:59" ) || 
	'4xCounter5'[received_at_only_time] >= TIMEVALUE ( "00:00:00" ) && '4xCounter5'[received_at_only_time] <= TIMEVALUE ( "06:00:00" ) 
)

Thank you, that worked perfectly. I was busy with making two different measures. But this is much better.

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors