Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Age calculation

I have a sample table, in that i sales id i need to create the age for the sales id's as per the status

if the status is open

From "Created Date" till Today  ; If CLOSED (WON or LOST)  From "Created Date" till "WonLostDate"

 

kindly help me on this 

 

need to write a measure

  • Anonymous Maybe:

    Column = 
      SWITCH(TRUE(),
        [Status] = "Open", ( TODAY() - [Created Date] ) * 1.,
        [Status] = "Won" || [Status] = "Lost", ( [WonLostDate] - [Created Date] ) * 1.
      )

1 Reply

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    Anonymous Maybe:

    Column = 
      SWITCH(TRUE(),
        [Status] = "Open", ( TODAY() - [Created Date] ) * 1.,
        [Status] = "Won" || [Status] = "Lost", ( [WonLostDate] - [Created Date] ) * 1.
      )