cancel
Showing results for 
Search instead for 
Did you mean: 
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

Accepted Solutions
Super User III
Super User III

Re: min and max of each row between dates - Power BI

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()

 

 

Hamburg - Germany
If I answer your question, please mark my post as solution, this will also help others.
I accept Kudos :-), If you find my post helpful.

Proud to be a Datanaut!

View solution in original post

3 REPLIES 3
Super User III
Super User III

Re: min and max of each row between dates - Power BI

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()

 

 

Hamburg - Germany
If I answer your question, please mark my post as solution, this will also help others.
I accept Kudos :-), If you find my post helpful.

Proud to be a Datanaut!

View solution in original post

JohnJairoV Helper I
Helper I

Re: min and max of each row between dates - Power BI

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

umeshjss
Regular Visitor

Re: min and max of each row between dates - Power BI

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

How'll don in case of directquery.

 

Thanks,Umesh

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Top Solution Authors
Top Kudoed Authors