Forum Discussion
ravi_ch
4 years agoHelper I
How can we calculate dates difference
How can we calculate no. of days between two days like 2/12/2020 - 2/20/2020 = 8, 2/20/2020 - 3/24/2020 = 32 like this
truptis
4 years agoCommunity Champion
ravi_ch -> You can also do using DAX.
Step 1: Create index column starting with 1 (Transform data -> Index column -> Start from 1)
Step 2: using DAX create a new column
PreviousRow = Lookupvalue(tablename[Date], tablename[index_column], tablename[index_column] -1)
Step 3: Create another column for counting the difference
Count = DATEDIFF([Date], [PreviousRow], DAY)
ravi_ch -> Mark this as a solution & hit the thumbs up, if it works for you. Thanks.