cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
kdaya Regular Visitor
Regular Visitor

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.png2019-08-15 00_11_47-FD - Excel.pngrequest 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
Super User
Super User

Re: DATEDIFF Cross table with many to one table relationship

-- 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
New Kudos Received Badges Coming

New Kudos Received Badges Coming

Kudos to you if you earned one of these! Check your inbox for a notification.

Microsoft Implementation for Communities Wins Award

Microsoft Implementation for Communities Wins Award

Learn about the award-winning innovation that was implemented across Microsoft’s Business Applications Communities.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Kudoed Authors (Last 30 Days)
Users online (3,210)