Forum Discussion

kap84's avatar
kap84
New Member
3 years ago
Solved

Get value from another table if result from first is empty

Hi

 

I need to get a name from another table if it's empty on first table, I've tried following as a calculated column but it gives empty result. 

 

FirstName =

IF(ISBLANK 'Table_A'[FirstName_TableA]),
FIRSTNONBLANK( 'Table_B'[FirstName_TableB], [FirstName_TableB),
'Table_A'[FirstName_TableA] )

Thanks in advance
  • I think with fields of type text, you might need to use IF('Table_A'[FirstName_TableA] = "", ...) as the condition instead. 

5 Replies

  • I think with fields of type text, you might need to use IF('Table_A'[FirstName_TableA] = "", ...) as the condition instead. 

  • Hi,

    What is the common field in both tables (based on which you want to bring overthe first name)?

    • kap84's avatar
      kap84
      New Member

      They are linked using a 3rd a table

      Column ID in table ALL_ID_id06 is used as a slicer on report.

       

       

       

       

  • Hi , kap84 

    According to the dax you provide , the FIRSTNONBLANK() function may use error.

    You can refer to this document:

    FIRSTNONBLANK function (DAX) - DAX | Microsoft Learn

     

    The second parameter is an expression evaluated for blanks for each value of column.

    Also , if you sitll return blank() , you can provide us with your special sample data and the desired output sample data in the form of tables, so that we can better help you solve the problem.

    Thank you for your time and sharing, and thank you for your support and understanding of PowerBI! 

     

    Best Regards,

    Aniya Zhang

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

  • This one did it. Excellent 🙂 Thank you.