Forum Discussion

Raphael33's avatar
Raphael33
New Member
2 years ago
Solved

Join 2 tables

Hello all,   I created a DAX table in which I created 2 variables, with which I get the data from 2 different tables.   I want to join these 2 tables in only one. I tried with UNION (but I don't ...
  • Greg_Deckler's avatar
    2 years ago

    Raphael33 Assuming that the relationship between the 2 tables is Material Code, perhaps this as your "join" VAR:

    var FirstJoinTable =
        ADDCOLUMNS(
            Launch_Intro_Table,
            "Affaire Planning Mode",
                VAR __MaterialCode = [Material Code]
                VAR __Result = MAXX( FILTER( MDPF71, [Material Code] = __MaterialCode), [Affaire Planning Mode" )
            RETURN
                __Result
            "Affaire Name",
                VAR __MaterialCode = [Material Code]
                VAR __Result = MAXX( FILTER( MDPF71, [Material Code] = __MaterialCode), [Affaire Name" )
            RETURN
                __Result
        )