Forum Discussion
Anonymous
5 years agoNot applicable
If and else linked data sources
Good Day, I was hoping someone could assist me in a very simple(to you) query with a result return. Scenario: I have two main columns that will contain a log of information. The one column wo...
- 5 years ago
Anonymous, it helps.
Try the below DAX code in a calculated column.
Type = SWITCH(TRUE(),'Table'[Source] IN VALUES(UserMaster[User extension]),"Outgoing", 'Table'[Destination] IN VALUES(UserMaster[User extension]),"Incoming")Note: You have to change the Table names as per your model. - 5 years ago
Try this,
Type = SWITCH(TRUE(),'Table'[Source] IN VALUES(UserMaster[User extension]) && 'Table'[Destination] IN VALUES(UserMaster[User extension]),"Internal",'Table'[Source] IN VALUES(UserMaster[User extension]),"Outgoing", 'Table'[Destination] IN VALUES(UserMaster[User extension]),"Incoming")I am glad that It worked. Please mark it as Solution. Appreciate your kudos!
amitchandak
5 years agoSuper User
Anonymous , Try a new column like this in DAX
new column
var _1 countx(filter(Master, Master[Extension] =Data[Source]),Data[Source])
var _2 countx(filter(Master, Master[Destination] =Data[Source]),Data[Source])
return
Switch( True() ,
not(isblank(_1)), "Outgoing",
not(isblank(_2)), "Incoming"
)
Anonymous
5 years agoNot applicable
InOut =
var _1 countx(filter(UserMaster, UserMaster[User Extension] =Data[Source]),Data[Source])
var _2 countx(filter(UserMaster, UserMaster[User extension] =Data[Source]),Data[Source])
return
Switch( True() ,
not(isblank(_1)), "Outgoing",
not(isblank(_2)), "Incoming"
)
It doesnt like the code marked in red.