Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

If Statement to Compare Two Values From Different Tables

All, 

 

I am making a table in PBI and have all I need except for one missing piece. 

The highlighted event represents a problem that occurs occasionally. 

 

I have the Last Crew field which simply is this the last unitname frim the crew action table: 

 

If that field is blank though, I want to take the Who Completed field listed right beside it. 

 

Does anyone know a dax formula (I'm sure it is some sort of IF statement) to combine those two into one column? I am unsure how the Last option in field wells work, so any insight would be amazing.

 

Thanks! 

 

If I can provide any more insight, please let me know.

 

8 Replies

  • Hi Collin,

     

    Are "Last Crew" and "Who completed" fields from the same table ?

     

    You can simply create une new column with this formula :

     

    New Column = IF(ISBLANK('Table'[Last crew]), 'Table'[Who completed], 'Table'[Last crew])
     
    Regards,
     
    Rudy
    • Anonymous's avatar
      Anonymous
      Not applicable

      They are in two separate tables. The last crew was unitname from the 'Crew Actions' table and Who Completed is from the 'Jobs' table. I am using the Last function on the dropdown to get the last crew, so I am not necessarily sure how to write that in DAX. That is where my confusion is coming from. 

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        I renamed 'unitname' to 'last crew' so end users don't get confused.

    • Anonymous's avatar
      Anonymous
      Not applicable

      They are joined in the model view on event_idx if that provides any additional insight

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 

    Has your problem been solved ? If it has been solved, then please consider Accept it as the solution to help the other members find it more quickly.

     

    Best Regard

    Community Support Team _ Ailsa Tao