cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JohnJairoV Regular Visitor
Regular Visitor

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
Super User

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.
Proud to be a Datanaut!

View solution in original post

3 REPLIES 3
Super User
Super User

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.
Proud to be a Datanaut!

View solution in original post

JohnJairoV Regular Visitor
Regular Visitor

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!

Highlighted
umeshjss Frequent Visitor
Frequent 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
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

New Badges

Incoming: New and Improved Badges

Exciting news: We've given our badges an overhaul and added brand news ones.

Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 297 members 2,788 guests
Please welcome our newest community members: