Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
georgec96
Helper II
Helper II

First and last datetime stamp

Hi everyone, I have the following dataset 

georgec96_0-1662553194823.png

 

I am trying to get the first and last datetime stamp for each shift (there are multiple shifts A,B,C,D) per day.

 

I have tried this formula but it doesn't work due to duplicated rows in the trndte column.

 

Measure = CALCULATE ( MIN ( 'Table'[trndte]), FIRSTDATE ( 'Table'[trndte] ) )

 

Any ideas would be much appreciated

 

Thanks

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @georgec96 

please try New Column

Last DateTime =
CALCULATE (
    MAX ( 'Table'[trndte] ),
    ALLEXCEPT ( 'Table', 'Table'[Shift], 'Table'[Date] )
)

 

View solution in original post

3 REPLIES 3
tamerj1
Super User
Super User

Hi @georgec96 

please try New Column

Last DateTime =
CALCULATE (
    MAX ( 'Table'[trndte] ),
    ALLEXCEPT ( 'Table', 'Table'[Shift], 'Table'[Date] )
)

 

@tamerj1  worked, thank you 

Anonymous
Not applicable

Hi @georgec96,
Can you try 
MinDate = CALCULATE ( MIN ( 'Table'[trndte]), ALLEXCEPT('Table'[Shift]))
MaxDate = CALCULATE ( MAX ( 'Table'[trndte]), ALLEXCEPT('Table'[Shift]))

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.