Forum Discussion
Conditionally checking if a value from one column matches in another column
- 8 years ago
Column = IF([isPartial]
&& CALCULATE(COUNTROWS(aShouldSkip),
FILTER(aShouldSkip,aShouldSkip[Agent]=EARLIER(aShouldSkip[Agent])
&& aShouldSkip[Account]=EARLIER(aShouldSkip[Primary]))) >= 1,
TRUE()
,FALSE()
)aShouldSkip is my table name. Don't feel bad, took me a while to wrap my head around EARLIER until I finally realized it was just a way of saying "current value".
Column = IF([isPartial]
&& CALCULATE(COUNTROWS(aShouldSkip),
FILTER(aShouldSkip,aShouldSkip[Agent]=EARLIER(aShouldSkip[Agent])
&& aShouldSkip[Account]=EARLIER(aShouldSkip[Primary]))) >= 1,
TRUE()
,FALSE()
)
aShouldSkip is my table name. Don't feel bad, took me a while to wrap my head around EARLIER until I finally realized it was just a way of saying "current value".
- JoshEnglish8 years ago
Helper I
Thank you. I have to admit none of it makes sense. Some functions only seem to work in certain contexts. The tool tip for Earlier makes it sound like it does something completely different than what it does.
- Greg_Deckler8 years ago
Community Champion
You are correct on EARLIER, no doubt. EARLIER really only works in a table context, which typically means "not a measure" unless you are using something tricky like one of the "X" functions. And, I agree, the description of EARLIER is horrendous. But, if you think of it as "current value" you should be fine.