Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Kat_00
Frequent Visitor

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]:

  1. 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])

  2. 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!

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@Kat_00 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


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Kat_00
Frequent Visitor

Thank you so much for the help! Your suggestions worked perfectly!

Greg_Deckler
Community Champion
Community Champion

@Kat_00 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


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.