Forum Discussion

ovetteabejuela's avatar
ovetteabejuela
Icon for Impactful Individual rankImpactful Individual
9 years ago
Solved

DAX: Retrieve Fields Based on Time and Employee

Hi,   I have two tables, a movements data and a raw data.   The movements data keeps track of which department the employee had been in a particular duration or to which supervisor he was reporti...
  • Phil_Seamark's avatar
    9 years ago

    You could try creating a DAX table that combines the two tables as you suggest'.

     

    Just hit the "New Table" button on the modelling table and add this.  I've assumed your tables are named Raw and Movements

     

     

    New Table = SELECTCOLUMNS(
                    FILTER(
    		CROSSJOIN('Raw','Movements'),
                        'Raw'[id_employee]='Movements'[id_employee]
                        && 'Raw'[date_trans] >= 'Movements'[date_effective_start]
                        && 'Raw'[date_trans] <= 'Movements'[date_effective_end].[Date]
                        )
                    ,
    				"date_trans",'Raw'[date_trans],
    				"id_employee",'Raw'[id_employee],
    				"flag",'Raw'[flag],
                    "id_sup",'Movements'[id_sup],
                    "id_department",'Movements'[id_department]
    				)