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
sourajs
Frequent Visitor

Need help in creating a new table using DAX

I have two tables.

Table 1

Part Id, created date, region

 

Table 2

Tender id, Tender date, region

 

Now the above two tables has many to many relationship and has no dependency between themselvs. I want to create a new table with data from this two tables into one with below clause tender date < Part created date < tender date + 7

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@sourajs , Try like

filter(crossjoin(Table1,table2),[tender date]<[Part created date] && [Part created date]<=[tender date]+7)

As both region has same name, you might have to use selectcolumns to rename

 

Or like
summarize(filter(table1,table1[Tender date]<=max(Table2[Part created date]) && max(Table2[Part created date])<=table1[tender date]+7)
,Table1[part_id], table2[tendar_id], table1[region])

View solution in original post

Thanks @amitchandak  .. This worked.

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Why not do it in Power Query? This is the place where such calculations really belong.

Best
D
amitchandak
Super User
Super User

@sourajs , Try like

filter(crossjoin(Table1,table2),[tender date]<[Part created date] && [Part created date]<=[tender date]+7)

As both region has same name, you might have to use selectcolumns to rename

 

Or like
summarize(filter(table1,table1[Tender date]<=max(Table2[Part created date]) && max(Table2[Part created date])<=table1[tender date]+7)
,Table1[part_id], table2[tendar_id], table1[region])

Thanks @amitchandak  .. This worked.

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.

Top Solution Authors