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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

IF TableA.Label is Blank Return TableB.Label Else Return TableA.Label

Hi,

I have 2 unrelated tables by relationship, but in terms of values there is some form of relationship.

I Need to create a column (Or Measure) that will return all the rows.

To understand a bit better, I have the following two tables:

Device & VirtualDevice

Each of these tables has a column called "Label".

I need to check and see if and when Device.Label is "blank"/null and return VirtualDevice.Label and visa-versa

I'm quite new (very new) and any help will be appreciated.

 

Thanks

2 REPLIES 2
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

If there has existed a one to one or many to one relationship between table 'Device' and 'VirtualDevice', you can create calculated columns using below DAX in 'Device'.

1.PNG2.PNG

Visa = RELATED(VirtualDevice[visa-versa])
Label = IF(Device[Device Label]=BLANK(),RELATED(VirtualDevice[Virtual Label]),Device[Device Label]) 

 

If you have created a many to one relationship or there is no relationship between these two tables, you could CrossJoin two tables to combine them into a single one, then filter rows based on some rules. If possible, please share some sample data stored in these two tables and show us an example of your desired result so that I can test for you.

 

Regards,
Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Reid_Havens
Most Valuable Professional
Most Valuable Professional

Hi there,

 

Happy to help. Couple of clarifying questions. Is there already a relationship between the two tables, and if yes do you know the type (E.g. One-to many, one-to-one, etc...) If there is already a relationship you should be able to create a column with a formula similar to below:

 

=
IF ( Device[Label] = BLANK (), VirtualDevice[Label], Device[Label] )

Reid Havens - Owner

Havens Consulting Inc.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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