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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
kdaya
Helper I
Helper I

DATEDIFF Cross table with many to one table relationship

Hi Community,

 

Please can you assist i am trying to subtract two dates from two different tables which have a many to one relationship

 

I have tried using RELATE but i think cause of the one to many relation that does not work

 

basically trying to subtract the min date for each account by all the dates for that account to get the days

 

2019-08-15 00_04_01-Support Customer Reporting - Power BI Desktop.pngrequest table will have mutiple dates for the customer and min_date table will have the min date for each customerrequest table will have mutiple dates for the customer and min_date table will have the min date for each customerdays

 

thanks in advance

 

 

 

1 REPLY 1
Anonymous
Not applicable

-- If you have a 1:many rel between
-- min_date and requests, then this
-- will work

[Days Since First Date] = -- calculated column in requests
var __thisDate = requests[Created Time]
var __firstDate = RELATED( min_date[First Date] )
return
	__thisDate - __firstDate

 

Please note that such calculations should be performed in Power Query, not in DAX.

 

Best

Darek

Helpful resources

Announcements
March Fabric Community Update

Fabric Community Update - March 2024

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

Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors