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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.