Forum Discussion
Compare values with if statement
Seeing the table helps, try this calculated column
HigherGradeFlag =
VAR CurrentID = Table1[ID]
VAR CurrentGrade = Table1[Grade]
VAR PreviousGrade =
CALCULATE (
MAX ( Table1[Grade] ),
FILTER ( Table1, Table1[ID] = CurrentID && Table1[Grade] < CurrentGrade )
)
RETURN
IF ( CurrentGrade > PreviousGrade, 1, 0 )
its not working , please check the attachement
the first 2 grade value should have been 0 since they are not higher than any other values in the same field
- AbhinavJoshi3 years agoResponsive Resident
Sorry for the missight, try this
HigherGradeFlag =
VAR CurrentID = Table1[ID]
VAR CurrentGrade = Table1[Grade]
VAR PreviousGrade =
CALCULATE (
MAX ( Table1[Grade] ),
FILTER ( Table1, Table1[ID] = CurrentID && Table1[Grade] < CurrentGrade )
)
VAR IsFirstOccurrence =
CALCULATE (
COUNTROWS ( Table1 ),
FILTER ( Table1, Table1[ID] = CurrentID && Table1[Grade] < CurrentGrade )
) = 0
RETURN
IF ( IsFirstOccurrence || CurrentGrade > PreviousGrade, 1, 0 ) - ragygad3 years agoFrequent Visitor
its erroring