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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
hxkresl
Helper V
Helper V

DAX: is it possible to join two tables M:M relationship?

Since model doesn't allow, can DAX be used to join two standalone table on columns eg. Datekey, which are not unique to the row in either table?  I can do it in SQL.  I have datekeys in left table that match datekeys in right table and i do an inner join to return all matches.

 

I can't model this in Desktop, but can I do this with DAX and return a full table result?

3 REPLIES 3
Eric_Zhang
Employee
Employee

@hxkresl

In below case, table1 and table3 are Many to Many

 

Capture.PNG

 

"can DAX be used to join two standalone table on columns"

You could try a CROSSJOIN with filters or NATURALINNERJOIN to create a calculated table.

 

i am proposing a M:M relationship between 2 tables having no bridge table, so would be joining on columns that are not unique within respective tables (such as DATEKEY).

 

Table 1:

Datekey (not unique to row)

HoursDown

Application

 

Table 2:

Datekey (not unique to row)

Alert

 

Is that possible do DISTINCT plus CROSSJOIN or NATURALINNERJOIN to get a combined distinct set?


@hxkresl wrote:

i am proposing a M:M relationship between 2 tables having no bridge table, so would be joining on columns that are not unique within respective tables (such as DATEKEY).

 

Table 1:

Datekey (not unique to row)

HoursDown

Application

 

Table 2:

Datekey (not unique to row)

Alert

 

Is that possible do DISTINCT plus CROSSJOIN or NATURALINNERJOIN to get a combined distinct set?


@hxkresl

Even with SQL, what would it return? Could you post any sample data and expected output?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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