Forum Discussion
ragygad
3 years agoFrequent Visitor
Compare values with if statement
I have a table with multiple fields and my main concern is 2 fields, one has ID and the other has grade (numerical field). I am trying to check first id ID to ID match in the same field and if they...
AbhinavJoshi
3 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 )
ragygad
3 years agoFrequent Visitor
its erroring