Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

DAX to create a column from difference of dates within the group

Hi,   As per the below snippet, I need to create a Slip days, based on Baseline Date. For every Project ID/Name, there is baseline date and they will add new rows with different baseline date with ...
  • ryan_mayu's avatar
    4 years ago

    Anonymous 

    you can create a column

    Column = 'Table'[Baseline Date]-CALCULATE(min('Table'[Baseline Date]),ALLEXCEPT('Table','Table'[Project ID],'Table'[Project Name]))

     

    or a measure

    Measure = DATEDIFF(CALCULATE(min('Table'[Baseline Date]),ALLEXCEPT('Table','Table'[Project ID],'Table'[Project Name])),MAX('Table'[Baseline Date]),DAY)

     

    pls see the attachment below