Forum Discussion
Anonymous
2 years agoNot applicable
New Colum based on ID
I'm looking to create a new column in my data model that displays different values based on the user[ID]:
If user[ID] >= 50, I want to retrieve the name from the entity table using the formula: LOOKUPVALUE(entity[Name], entity[Entity ID], user[Entity ID])
If user[ID] < 50, I want to retrieve the name from the old_entity table using the formula: LOOKUPVALUE(old_entity[Name], old_entity[Entity ID], user[Entity ID])
I'm not sure how to accomplish this in DAX. Can anyone help with the correct DAX formula for this scenario?
Thank you!
Anonymous Seems like:
Column in User Table = VAR __ID = [ID] VAR __Result = SWITCH( TRUE(), [ID] >= 50, LOOKUPVALUE( entity[Name], entity[Entity ID], __ID ), LOOKUPVALUE( old_entity[Name], old_entity[Entity ID], __ID ) ) RETURN __Result
2 Replies
- Greg_Deckler
Community Champion
Anonymous Seems like:
Column in User Table = VAR __ID = [ID] VAR __Result = SWITCH( TRUE(), [ID] >= 50, LOOKUPVALUE( entity[Name], entity[Entity ID], __ID ), LOOKUPVALUE( old_entity[Name], old_entity[Entity ID], __ID ) ) RETURN __Result - AnonymousNot applicable
Thank you so much for the help! Your suggestions worked perfectly!