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
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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

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

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.