Forum Discussion

Surya1's avatar
Surya1
Helper I
8 years ago
Solved

DAX

Hi All,   Someone please help   I have 2 questions.   Q1.There are 2 tables,Table 1 and Table 2 with a unique column called ID.I want to add a column called status in Table 1 by matching the ID...
  • Anonymous's avatar
    Anonymous
    8 years ago

    Reading over your whole post i'm thinking this should be done in Power Query instead of dax.  Never the less, here is the dax for Q1

     

    Q1:  Create a Custom Column:

    Status = var thisRecord = [ID]
    RETURN
    CALCULATE(
    	COUNTROWS('Table2'),
    	ALL('Table2'),
    	'Table2'[ID] = thisRecord
    ) > 0

     

    Q2:  I really really stress this is going to be a bad idea.  The 'Edit Queries' are of Power BI is much better suited to creating tables.  Q1 could also be achieved there as well.

     

    Is there a specific reason you want to do this with Dax?