Forum Discussion
COnditonal Column
- 3 years ago
Please try
MeasureDifference =
VAR FirstSelectedDate =
CALCULATE (
MIN ( 'PM On Time Performance Bus PM-BI-002 (2)'[Completion Date.Completion Date Level 01] ),
ALLSELECTED (),
VALUES ( 'PM On Time Performance Bus PM-BI-002 (2)'[Equipment.Equipment Level 01.Key] )
)
RETURN
SUMX (
'PM On Time Performance Bus PM-BI-002 (2)',
IF (
'PM On Time Performance Bus PM-BI-002 (2)'[Completion Date.Completion Date Level 01] = FirstSelectedDate,
0,
'PM On Time Performance Bus PM-BI-002 (2)'[Variable Difference]
)
)
tamerj1 yes this is almost exactly what I need! the formula is working great, just need to add the contional rule on top of it.
so, if there is there is no previous matyching equipment ID the Variable Difference formula should equal 0.
if there is a previous equipment ID, the formula needs to run.
In this example, the equipment key = 1104, variable difference should yield a "0" because there is no other previous record of 1104.
But the second record of1105 is correct, because there is a previous record.
Strange! It should return 0. Actually this is the purpose of the COALESCE. Would you please share the code that you have used?
- amandabus213 years agoHelper V
tamerj1 I used the one you provided above.
Only other thing I could maybe think of is a Date Slicer added using, "Completion Date.Completion Date Level 01"
- tamerj13 years agoCommunity Champion
Please try adding a new measure
MeasureDifference =
SUMX (
'PM On Time Performance Bus PM-BI-002 (2)',
IF (
'PM On Time Performance Bus PM-BI-002 (2)'[Completion Date.Completion Date Level 01]
= CALCULATE (
MIN ( 'PM On Time Performance Bus PM-BI-002 (2)'[Completion Date.Completion Date Level 01] ),
REMOVEFILTERS (),
VALUES ( 'PM On Time Performance Bus PM-BI-002 (2)'[Equipment.Equipment Level 01.Key] )
),
'PM On Time Performance Bus PM-BI-002 (2)'[Variable Difference]
)
)- amandabus213 years agoHelper V
This gave blank values.
If i remove ""Sum" from Variable difference, the whole table goes blank.