Forum Discussion

jmspbooth's avatar
jmspbooth
Frequent Visitor
4 years ago

Count days between date rows in single column

Referenced the below thread but wasnt able to get it working for me. I have a single column thats formatted as 'Date'. I need to be able to calulate the difference between the 'Days submitted'. This list has multiple different 'system acronym' fields that are being filtered on the visualization by a slicer. There is another field for 'System Version' that could also be referenced to differentiate, but it is a text field using the 'x.x.x.x' syntax.

 

https://community.powerbi.com/t5/Desktop/Calculating-time-between-two-rows-in-the-same-column/td-p/1275211

 

 

 

Any help is greatly appreciated!

 

 

4 Replies

    • jmspbooth's avatar
      jmspbooth
      Frequent Visitor

      Since my company has our connection filtered I cant get to that normally and have been working through it from another PC at home. So its taking me a little longer. 

      When I had a small data set it worked perfectly. I ingested a larger dataset that is being filtered out by a slicer and it stopped calulcating correctly. 

       

      The source table is going to be updates by multiple different teams and I need to calculate the differene in time between submission dates per team. (i.e Team A submits 1/1/22, Team B submits 1/15/22, Team A submits 2/1/22, Now calculate the difference in time between Team A submit (1) and submit (2)). There are ~75 teams each with their own submission schedule. 

      Ultimately I need to make sure each team is submitting information every 30 days. So this calculation is to track that and display on a stacked area chart.

  • v-zhangti's avatar
    v-zhangti
    Icon for Community Support rankCommunity Support

    Hi, jmspbooth 

     

    You can try the following methods.

    Column:

     

    Previous Date =
    MAXX (
        FILTER ( 'Table', [Date Submitted] < EARLIER ( 'Table'[Date Submitted] ) ),
        [Date Submitted]
    )
    
    Difference = 
    IF([Previous Date]<>BLANK(),[Date Submitted]-[Previous Date],BLANK())

    Is this the output you expect?

     

     

    Best Regards,

    Community Support Team _Charlotte

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    • jmspbooth's avatar
      jmspbooth
      Frequent Visitor

      This didnt work for me. I added more detail in my response from tackytechtom if you want to look there. Below is what I get at the end.