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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
tiwari_456
Regular Visitor

How to find min. and max. value on a day/date

I have a table (SampleResult) in which we have 2 columns let's say "RequestDate" and "CompletedDate", on the date we get requests is in RequestDate and the date we have completed is in CompletedDate.
So for a scenario, we have 3 requests on a particular date and their completed dates are different, then how can we find the maximum and minimum time taken by the requests on that date?
Like that, we have to find for the whole table.

Request IDRequestDateCompletedDateTimeDiffMinTimeMaxTime
1234/23/20234/26/2023   
1245/24/20235/25/2023   
1255/24/20235/26/2023   
1265/24/20235/27/2023   
1 ACCEPTED SOLUTION
v-xuxinyi-msft
Community Support
Community Support

Hi @tiwari_456

 

You can try the following steps:

 

1. Create a calculated column as follows.

TimeDiff = DATEDIFF('Table'[RequestDate], 'Table'[CompletedDate], DAY)

 

2. Create several measures as follow:

 

MinTime = CALCULATE(MIN([TimeDiff]), ALLEXCEPT('Table', 'Table'[RequestDate]))
MaxTime = CALCULATE(MAX('Table'[TimeDiff]), ALLEXCEPT('Table', 'Table'[RequestDate]))

 

vxuxinyimsft_0-1704779161807.png

 

Is this the result you expect?

 

Best Regards,
Community Support Team _Yuliax

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-xuxinyi-msft
Community Support
Community Support

Hi @tiwari_456

 

You can try the following steps:

 

1. Create a calculated column as follows.

TimeDiff = DATEDIFF('Table'[RequestDate], 'Table'[CompletedDate], DAY)

 

2. Create several measures as follow:

 

MinTime = CALCULATE(MIN([TimeDiff]), ALLEXCEPT('Table', 'Table'[RequestDate]))
MaxTime = CALCULATE(MAX('Table'[TimeDiff]), ALLEXCEPT('Table', 'Table'[RequestDate]))

 

vxuxinyimsft_0-1704779161807.png

 

Is this the result you expect?

 

Best Regards,
Community Support Team _Yuliax

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Fabric Monthly Update - May 2024

Check out the May 2024 Fabric update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors