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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
LyonsBI_BRL
Helper III
Helper III

Lookup Value and Return Value if no value Present

I have an issue with a table where I need to assign a value to a row IF no data is present from the LOOKUP table. 

 

I have a calculated column for SCORE

 

Score = LOOKUPVALUE(statuses[score],statuses[RegistrantId],[RegistrantID])

I've tried writing a piece of code here to see if that would work but am running into a road block. 

Exists = IF('All Applicants - '[Score] in ALL('All Applicants - 1'[Score]),[Score],"No Score")

Any suggestions would be greatly appreaciated. 

 

Thanks!

 

1 ACCEPTED SOLUTION
v-robertq-msft
Community Support
Community Support

Hi, @LyonsBI_BRL 

According to your description, I can roughly understand your requirement, I think that you can simply change the original DAX formula like this:

Score =

var _value=LOOKUPVALUE(statuses[score],statuses[RegistrantId],[RegistrantID])

return

IF(_value<>BLANK(),FORMAT(_value,""),"No score")

 

And you can get what you want, like this:

vrobertqmsft_0-1624348910176.png

 

You can download my test pbix file below

 

If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-robertq-msft
Community Support
Community Support

Hi, @LyonsBI_BRL 

According to your description, I can roughly understand your requirement, I think that you can simply change the original DAX formula like this:

Score =

var _value=LOOKUPVALUE(statuses[score],statuses[RegistrantId],[RegistrantID])

return

IF(_value<>BLANK(),FORMAT(_value,""),"No score")

 

And you can get what you want, like this:

vrobertqmsft_0-1624348910176.png

 

You can download my test pbix file below

 

If this result is not what you want, you can post some sample data(without sensitive data) and your expected result.

How to Get Your Question Answered Quickly 

Thank you very much!

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

LyonsBI_BRL
Helper III
Helper III

@Anonymous 

Awesome idea! Just tried it though I'm getting this below

LyonsBI_BRL_0-1624204261950.png

 

Anonymous
Not applicable

Can you add a model relationship? If so you can just go COALESCE(RELATED('lookuptable' [column]), "my alternative value") 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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