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
Hi ravi_ch , Please try this:
Step 1: create index column using dax:
Index_column = RANKX(ALL('Tablename'),[Date])
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.