Forum Discussion
Conditional column based on two other columns
Hi.
I have these two columns where I would like to return a value of a third value. If parent ID also exist in the "id" column then I would like to know the "sagstype" value of that one in a seperat column. How do I do that? 🙂
Is this what you are looking for?
6 Replies
- amitchandakSuper User
Anonymous ,
new column =
var _count = countx(filter(Table, Table[ID] = earlier(Table[Parent ID]) ), Table[ID])
return
if(not(isblank(_count)) , "sagstype", blank())
- AnonymousNot applicable
amitchandak
I dont want the text "Sagstype" - I want the value in the "sagstype" column 🙂
"Sagstype" is the third column in the image.Also something is missing. Some of the "Parent ID" I can't find in the "id" column 🙂
- ArulSuper User
Anonymous ,
try this in calculated column,
Type Matching = VAR _distinctId = VALUES('Table'[id]) VAR _result = IF('Table '[Parent ID] IN _distinctId,'Table'[Sagstype],BLANK()) RETURN _resultThanks,
Arul
- AnonymousNot applicable
Arul
Unfortunately it does not work correctly. It just returns the same value as in the same row.I tried to illustrate it in the image below:
Out from id is the "sagstype" incident and the parent ID is the "sagstype" reguest for change. And I want the "request for change" returned in the calculated column not incident 🙂
- AhmedxSuper User
Is this what you are looking for?
- AnonymousNot applicable
Yes, thank you! It works perfectly!