Forum Discussion
Anonymous
9 years agoNot applicable
Create Measure / Column with IF using schedule.
I need to create a measure or field in which depending on the current schedule of my system it shows in which shift we are, for example: Today we have the 24 hours divided into 3 shifts: Turn A ...
- 9 years ago
Anonymous
This could help you in case of calculated column?
CalcShift_ = /* Shift 1 6:00:00 - 13:59:59*/ /* Shift 2 14:00:00 - 21:59:59*/ /* Shift 3 22:00:00 - 05:59:59*/ IF ( HOUR ( [CurrentTIme] ) >= 6 && HOUR ( [CurrentTIme] ) <= 13; 1; IF ( HOUR ( [CurrentTIme] ) >= 14 && HOUR ( [CurrentTIme] ) <= 21; 2; IF ( HOUR ( [CurrentTIme] ) >= 22 && HOUR ( [CurrentTIme] ) <= 23; 3; IF ( HOUR ( [CurrentTIme] ) >= 0 && HOUR ( [CurrentTIme] ) <= 5; 3; 0 ) ) ))
gpiero
9 years agoSkilled Sharer
Anonymous
This could help you in case of calculated column?
CalcShift_ =
/* Shift 1 6:00:00 - 13:59:59*/
/* Shift 2 14:00:00 - 21:59:59*/
/* Shift 3 22:00:00 - 05:59:59*/
IF (
HOUR ( [CurrentTIme] ) >= 6
&& HOUR ( [CurrentTIme] ) <= 13;
1;
IF (
HOUR ( [CurrentTIme] ) >= 14
&& HOUR ( [CurrentTIme] ) <= 21;
2;
IF ( HOUR ( [CurrentTIme] ) >= 22 && HOUR ( [CurrentTIme] ) <= 23; 3;
IF ( HOUR ( [CurrentTIme] ) >= 0 && HOUR ( [CurrentTIme] ) <= 5; 3; 0 )
)
))
Anonymous
9 years agoNot applicable
Thank you it worked.
Now there has arisen a need to apply this measure, which I have created in a new measure where I make the following calculation:
UnitsBoats (Unit) L1_CFA = CALCULATE (IF (ISBLANK (CALCULATE ( SUM ('IndicatorValue' [Value]);
TREATAS ({"UnitsBoas (Unit)")}; 'Indicator' [Description]); Equipment [Description] = "L1_CFA")); 0;
CALCULATE (SUM ('IndicatorValue' [Value]); TREATAS ({"UnitsBoas (Unit)")}; 'Indicator' [Description])
; Equipment [Description] = "L1_CFA")))
The goal would be to use the value of the measure that you passed me as a filter, would that be possible?