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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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 

Aditya_Meshram
Solution Supplier
Solution Supplier

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors