cancel
Showing results for
Did you mean:
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.

I have the following columns:

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:

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.

With kind regards,
Matthias

1 ACCEPTED SOLUTION
Super User

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" )
)``````
2 REPLIES 2
Super User

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" )
)``````
Frequent Visitor

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

Announcements

#### The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

#### Ted's Dev Camp - July 28, 2022

Watch Session 24 of Ted's Dev Camp along with past sessions!

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

Top Solution Authors
Top Kudoed Authors