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
JohnJairoV
Helper I
Helper I

min and max of each row between dates - Power BI

Hi, to all!

 

This time I want to calculate the min (and max) of each row between dates (dd-mm-yyyy format)

 

Date 1Date 2Date 3Min ResultMax Result
04/05/201716/02/201720/09/201620/09/201604/05/2017
nullnullnullnullnull
09/02/2017null05/08/201605/08/201609/02/2017
25/05/201610/08/201719/12/201625/05/201610/08/2017
null06/07/2017null06/07/201706/07/2017
04/08/201715/09/201620/04/201715/09/201604/08/2017
16/07/2017null04/06/201604/06/201616/07/2017
     

 

The columns Date 1, Date 2, Date 3 are non-contiguous (if is important to know) and I have another columns between the date's column.  Where is easiest to calculate? in PowerQuery?, in PowerPivot?, how can I calculate the desire results?

 

In Excel is really easy to calculate.  I don't find the easy way.

 

Thx in advanced for your answers.  Blessings!

1 ACCEPTED SOLUTION
TomMartens
Super User
Super User

I would do this in PowerQuery.

 

Create a custom column with the following formula:

 

List.Min({[Date1],[Date2],[Date3]})

Beware the braces, that convert the column values into a list whereas the function returns the Minimum Value from the list. For the Maximum value use List.Max()

 

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

View solution in original post

3 REPLIES 3
TomMartens
Super User
Super User

I would do this in PowerQuery.

 

Create a custom column with the following formula:

 

List.Min({[Date1],[Date2],[Date3]})

Beware the braces, that convert the column values into a list whereas the function returns the Minimum Value from the list. For the Maximum value use List.Max()

 

 



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

This is not working when connection live and using the direct query option.

How'll don in case of directquery.

 

Thanks,Umesh

Thanks.  This work for me.  I see the Power Pivot method, and I don't like.  Blessings!

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.