Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

DAX formula for calculated column to get consecutive text values from two different tables

  Hello All, I have three tables including.    Table1                          Table2                                          Table3 I am trying to create a DAX formula as a calcu...
  • Anonymous's avatar
    Anonymous
    6 years ago

    Hi Anonymous 

     

    I think this is something to do with the sequence of events in PBI. Looks like calculate columns are calculated before the relations are enforced. In your case, the formula tries to return an entire column where a single value is expected.

     

    The measure below (created as Measure, not a Calculated Column!) does what you seem to need:

    Username = 
    var TEMP_ID = CALCULATE(MAX(Table1[Method])) 
    var U_Name = CALCULATE(MAX(Table2[U_Name])) 
    var D_Name = CALCULATE(MAX(Table3[D_Name])) 
    return
    if(TEMP_ID=1, U_Name, D_Name)

     

     

    Kind regards,

    JB