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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
grggmrtn
Post Patron
Post Patron

DAX column using LOOKUPVALUE - what if the value isn't there?

I have the following calculated column, and it works fine(ish):

Column =
IF (
    'citizen'[Source] = "1.1",
    LOOKUPVALUE ( 'citizen2'[Other Source], 'citizen2'[id], 'citizen'[id] ),
    "no"
)

But now I've run into the situation where 'citizen2'[id] doesn't exist, so I get "" as a result. How can I insert another IF statement that will output "1.1.1" if Source = "1.1" and the LOOKUPVALUE is ""?

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@grggmrtn , not very clear, try with switch-like

 

Column =
Switch (true() ,
LOOKUPVALUE ( 'citizen2'[Other Source], 'citizen2'[id], 'citizen'[id] ) = "1.1.1", "<>" ,
'citizen'[Source] = "1.1", LOOKUPVALUE ( 'citizen2'[Other Source], 'citizen2'[id], 'citizen'[id] ),
"no"
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@grggmrtn , not very clear, try with switch-like

 

Column =
Switch (true() ,
LOOKUPVALUE ( 'citizen2'[Other Source], 'citizen2'[id], 'citizen'[id] ) = "1.1.1", "<>" ,
'citizen'[Source] = "1.1", LOOKUPVALUE ( 'citizen2'[Other Source], 'citizen2'[id], 'citizen'[id] ),
"no"
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks @amitchandak that worked great - I just had to switch your code up a bit:

Column =
Switch (true() ,
LOOKUPVALUE ( 'citizen2'[Other Source], 'citizen2'[id], 'citizen'[id] ) = "", "1.1.1" ,
'citizen'[Source] = "1.1", LOOKUPVALUE ( 'citizen2'[Other Source], 'citizen2'[id], 'citizen'[id] ),
"no"
)

It does just what I need 🙂

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors