Forum Discussion

vijay22kar's avatar
vijay22kar
Icon for Helper II rankHelper II
6 years ago

Get projectwise first date and last date from date table

Hi All,

Sorry, for the inconvenience I'm asking the very basic question.

I want First date and last date from the two different columns 

I'm trying below measures but it's not work

first date = FIRSTDATE(project baselines'[ProjectBaselineStartDate])
and 
FirstDate1 = CALCULATE(FIRSTDATE('ProjectBaselines'[ProjectBaselineStartDate]), ALLSELECTED(AssignmentBaselines[AssignmentBaselineStartDate]))
 
dataset 
 
Project nameProjectBaselineStartDateProjectBaselineEndDateProjectStartDateProjectendDate
HRMS2019-07-22 2019-11-162020-08-01 2020-05-25
HRMS2019-07-222019-09-172020-08-012020-05-15
 
Expected result (unique project name)
 
HRMS2019-07-22 2019-09-172020-08-01

2020-05-25

 

Thank You.

2 Replies

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

    Hi vijay22kar ,

     

    You can just change the aggregation mode to first or last on date columns.

     

    Did I answer your question? Mark my post as a solution!
    Ricardo

  • v-lili6-msft's avatar
    v-lili6-msft
    Icon for Community Support rankCommunity Support

    hi  vijay22kar 

    Create four measure as below:

    first date for ProjectBaselineStartDate = CALCULATE(FIRSTDATE(ProjectBaselines[ProjectBaselineStartDate]))
    
    first for ProjectBaselineEndDate = CALCULATE(FIRSTDATE(ProjectBaselines[ProjectBaselineEndDate]))
    
    Last date for ProjectendDate = CALCULATE(LASTDATE(ProjectBaselines[ProjectendDate]))
    
    Last date for ProjectStartDate = CALCULATE(LASTDATE(ProjectBaselines[ProjectStartDate]))

    Then drag Project name field and these four measure into a table visual

     

     

    Regards,

    Lin