Forum Discussion

Dk_bbr's avatar
Dk_bbr
Regular Visitor
2 years ago
Solved

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?

  • 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 measure
    measure = AVERAGE('Table'[Column])
     
    pls see the attachment below
     

4 Replies

    • Dk_bbr's avatar
      Dk_bbr
      Regular Visitor
      DateGuideIDGuideNameComesInSales
      1/1/2310051Bam15000
      2/1/2310051Bam115022
      3/14/2310051Bam1151563
      5/24/2310051Bam115400
      5/30/2310051Bam13600
      6/15/2310051Bam19500
      7/23/2310051Bam14500
      8/1/2310051Bam13250
      8/15/2310051Bam18900

       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_mayu's avatar
        ryan_mayu
        Super 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 measure
        measure = AVERAGE('Table'[Column])
         
        pls see the attachment below
         
  • Uzi2019's avatar
    Uzi2019
    Community Champion

    Hi Dk_bbr 

    Give sample data of your model so we can provide you the solution.
    How many columns are there in your report?