Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
sabeensp
Helper IV
Helper IV

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
1 ACCEPTED SOLUTION
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. 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

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

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

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. 

Hi,

this is a good way to join queries!

Is there a way to join a query and a calculated table?

What I got is a query "query1" on quarterly based data. What I need is a monthly base.

So I build a date table and build another table "calc_table" with a groupby() on the month field and a calculated coloumn for the quarter names like in the "query1".

Now I tried to join "query1" and "calc_table" but I found no way to do that. Any ideas on that?

Best,

b.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.