Forum Discussion
If and else linked data sources
- 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!
UsermasterIncoming CallOutgoing Call
If a extension number exsits in the Usermaster and is displayed in the desination column then it would be marked as "Incoming" and if a extension number exsits in the source column then it would be "Outgoing", but if an extension matches in both columns it would be "Internal".
Please let me know if this helps? SivaMani
Anonymous,
You are using measure and it won't work for this code. Use the calculated column.
Refer this documentation: https://docs.microsoft.com/en-us/power-bi/transform-model/desktop-tutorial-create-calculated-columns
- Anonymous5 years agoNot applicable
SivaMani Wow, you are a Super Star.... One last question, if an extension matches the Master table and in both Data"Source" and Data"Destination" how can I make it "Internal".
- SivaMani5 years agoResident Rockstar
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!- Anonymous5 years agoNot applicable
SivaMani , Legend. Thank you. I have a whole bunch of other questions but let me try myself first prior to just posting on the forums. Thank you again.