Forum Discussion

almohalhel1408's avatar
almohalhel1408
Frequent Visitor
6 years ago
Solved

Delta Calculation for Duplicated row dates

hello every body ...

 

i have this table with duplicate rows for date column

i want to calculate the Delta for "Deaths" only  ? like a Measure

 

plz help me guys

 

country   date                                                 status               values     previos date

Spain04/16/2020395.570224334054Recovered 04/15/2020
Spain04/16/2020395.570224334054Active18494804/15/2020
Spain04/16/2020395.570224334054Delta_Confirmed730404/15/2020
Spain04/16/2020395.570224334054Deaths1931504/15/2020
Spain04/15/2020379.948293204569Recovered 04/14/2020
Spain04/15/2020379.948293204569Active17764404/14/2020
Spain04/15/2020379.948293204569Delta_Confirmed510304/14/2020
Spain04/15/2020379.948293204569Deaths1870804/14/2020
 
  • almohalhel1408 ,

    You can try a new column like

    Diff = [values] - maxx(filter(Table,[country] =earlier([country]) && [status] =earlier([status]) && [date] =earlier([date]) -1),[Value])

     

    This will diff between same status

3 Replies

  • almohalhel1408 ,

    You can try a new column like

    Diff = [values] - maxx(filter(Table,[country] =earlier([country]) && [status] =earlier([status]) && [date] =earlier([date]) -1),[Value])

     

    This will diff between same status

    • almohalhel1408's avatar
      almohalhel1408
      Frequent Visitor

      thank you sooo much it was like a magic ğŸ˜™

       

      can you give an explanation how the formula work

  • Hi,

    What's in the third column?  There is no title there.  Please show the exact expected result.