Forum Discussion
Mahadevaraobc
Helper II
6 years agoDifference between date and run if
Hi i have the following sample table, and i want to achieve the following.Each product can have multiple event nos. a) Calculate date difference between 1st and last events for same product b) Mar...
Nathaniel_C
Community Champion
6 years agoHi Mahadevaraobc ,
Here you go. Will post code in a minute.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
Nathaniel_C
Community Champion
6 years ago
Interesting issue, hope this helps.
If this solves your issues, please mark it as the solution, so that others can find it easily. Kudos are nice too.
Nathaniel
Here is my pbix https://1drv.ms/u/s!AgCd7AyfqZtExjCwBgNzr63TFQaz?e=dg6Nzh
First date = CALCULATE(MIN(Event[Date]),Event[Date],FIRSTDATE(Event[Date])) Elapsed Time = Var StartDate = CALCULATE(MIN(Event[Date]),Filter(ALLSELECTED(Event),min(Event[Date]))) Return DATEDIFF(StartDate,Event[First date],DAY) Is Re-event = IF([Elapsed Time]>3&& [Elapsed Time]<30,"Re-Event","") Event Span = DATEDIFF(FIRSTDATE(Event[Date]),LASTDATE(Event[Date]),DAY)