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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! 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
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors