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
tiwari_456
New Member

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
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.