Forum Discussion

sabeensp's avatar
sabeensp
Helper IV
7 years ago
Solved

Joining Table using DAX

Hello,
 
I'm creating a table using DAX in Power BI, but need help with the RETURN Part of the DAX.
MyTable =
VAR MyTable1 =
SELECTCOLUMNS( 'MyTable1',
"COl_1", 'MyTable1'[COL_1],
"COL_2", 'MyTable1'[COL_2]
)
VAR MyTable2 =
SELECTCOLUMNS(
'MyTable2',
"COL_3", 'MyTable2'[COL_3],
"COl_4", 'MyTable2'[COl_4]
)
 
RETURN ???
I want to return
MYTable1.COL_1, MYTable1.COL_2, MYTable2.COL_3, MYTable2.COL_4,
Where
MYTable1.COL_1 = MYTable2.COL_3
AND
MYTable1.COL_2 = MYTable2.COL_4
AND
MYTable2.COL_3 = "P"
AND
MYTable1.COL_1 > 20
Thanks
  • Anonymous's avatar
    Anonymous
    7 years ago

    I'd start here:

    https://docs.microsoft.com/en-us/powerquery-m/power-query-m-reference

     

    You will want to use Append or Merge. Load your data and go to Power Query ( Home-->Edit Queries-->Edit Queries). That will take you to Power Query and then in there go to the Home tab-->Combine (far left) and mess aroudn with the Merge and Append buttons. Each will take you to a wizard which should help greatly. Give it a shot and come back with any questions. 

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    You'd probably be better off using Power Query for this. Have you tried there?

    • sabeensp's avatar
      sabeensp
      Helper IV

      AnonymousNo, How do I do that. New to all this.

      • Anonymous's avatar
        Anonymous
        Not applicable

        I'd start here:

        https://docs.microsoft.com/en-us/powerquery-m/power-query-m-reference

         

        You will want to use Append or Merge. Load your data and go to Power Query ( Home-->Edit Queries-->Edit Queries). That will take you to Power Query and then in there go to the Home tab-->Combine (far left) and mess aroudn with the Merge and Append buttons. Each will take you to a wizard which should help greatly. Give it a shot and come back with any questions.