Forum Discussion

Gaurav_Lakhotia's avatar
Gaurav_Lakhotia
Helper III
5 years ago
Solved

Calculated Column for Latest Training Date - 2

Hi All,    Scenario: 1. There is a TrainingTracker table which has Date column (i.e. Training Date). I need to find out the date after 28 days of the Training Date. (For Example: If Training Date ...
  • v-lili6-msft's avatar
    5 years ago

    hi Gaurav_Lakhotia 

    For your case, add two calculate column as below:

    durationbetweennextdate = DATEDIFF('Training Tracker'[Date],MINX (
            FILTER (
                'Training Tracker',
                'Training Tracker'[Customer Name]
                    = EARLIER ( 'Training Tracker'[Customer Name] )
                    && 'Training Tracker'[Date] > EARLIER ( 'Training Tracker'[Date] )
            ),
            'Training Tracker'[Date]
        ),DAY
    
    )
    Result = MAXX(TOPN(1,FILTER('Training Tracker', 'Training Tracker'[Customer Name]
                    = EARLIER ( 'Training Tracker'[Customer Name] )&& 'Training Tracker'[Date] >= EARLIER ( 'Training Tracker'[Date] )&&([durationbetweennextdate]>=28||[durationbetweennextdate]=BLANK())
                    ),[Date],ASC),[Date])+28

    Result:

     

    regards,

    Lin