Forum Discussion
Dk_bbr
2 years agoRegular Visitor
how to find interval between dates
My english too bad for this hope you can understand. I have problem like some guide comes 10 time in year to my store and i need to find how much days to take between that 10 comes?
- 2 years ago
not sure if this is what you want
Column =VAR _last=maxx(FILTER('Table','Table'[GuideID]=EARLIER('Table'[GuideID])&&'Table'[Date]<EARLIER('Table'[Date])),'Table'[Date])return if(ISBLANK(_last),blank(),DATEDIFF(_last,'Table'[Date],DAY))then create a measuremeasure = AVERAGE('Table'[Column])pls see the attachment below
ryan_mayu
2 years agoSuper User
could you pls provide some sample data and expected output?
Dk_bbr
2 years agoRegular Visitor
| Date | GuideID | GuideName | ComesIn | Sales |
| 1/1/23 | 10051 | Bam | 1 | 5000 |
| 2/1/23 | 10051 | Bam | 1 | 15022 |
| 3/14/23 | 10051 | Bam | 1 | 151563 |
| 5/24/23 | 10051 | Bam | 1 | 15400 |
| 5/30/23 | 10051 | Bam | 1 | 3600 |
| 6/15/23 | 10051 | Bam | 1 | 9500 |
| 7/23/23 | 10051 | Bam | 1 | 4500 |
| 8/1/23 | 10051 | Bam | 1 | 3250 |
| 8/15/23 | 10051 | Bam | 1 | 8900 |
That ComesIn only equils to 1 and i want to know average interval days in these between 10 dates? is that possible like similar to in year 10 times and in a month 2 times?
- ryan_mayu2 years agoSuper User
not sure if this is what you want
Column =VAR _last=maxx(FILTER('Table','Table'[GuideID]=EARLIER('Table'[GuideID])&&'Table'[Date]<EARLIER('Table'[Date])),'Table'[Date])return if(ISBLANK(_last),blank(),DATEDIFF(_last,'Table'[Date],DAY))then create a measuremeasure = AVERAGE('Table'[Column])pls see the attachment below