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
Anonymous
Not applicable

In a 1:* relationship, if an item being looked up has no match then show the item, else show match

Hey,

 

I have a table with coded values:

- LM20

- LM30

 

And another table to decode those values:

- LM20 = Neon Blue

 

But many values have no match (like LM30 above). The result is a useless aggregation of all blanks in visualizations. Is there any way to tell Power BI to show me the coded value if the decoded value does not exist? I should mention that these tables are joined via a via an ID and Key, I'm unsure if DAX has a way to detect if something evaluates to a blank between relationships.

 

Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous

 

Try this.

 

DESCC = IF(RELATED(Detail[Desc])= BLANK(),Master[Code],RELATED(Detail[Desc]))

 

Thanks

Raj

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous

 

Try this.

 

DESCC = IF(RELATED(Detail[Desc])= BLANK(),Master[Code],RELATED(Detail[Desc]))

 

Thanks

Raj

Anonymous
Not applicable

I'll also add that while this works for the * side of the relationship, it does not work for the 1 side of the 1-* relationship. I worked around this by getting a distinctcount from the 1 side of the table, and subtracting it against a distinct count from the * side of the table, a positive number indicating some keys were missing.

Anonymous
Not applicable

Works like a charm as a new column, thank you very much!

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.