Forum Discussion
Mahadevaraobc
6 years agoHelper II
Difference 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
6 years agoCommunity Champion
Hi 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
6 years agoCommunity Champion
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)
- Mahadevaraobc6 years agoHelper IIThank you will check and get back...
- Mahadevaraobc6 years agoHelper II
Thanks Nathaniel_C,
This works but, there are few changes to be done, like.
Product should not be single select, when i unselect all, first date should be taken based on product 1st date and last date should be max of that product date and not all product dates.