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
Anonymous
Not applicable

most recent value date. how to do to use the type column ?

Hi ;

I would want to add a most recent value of date in the new column . I filled in the formula of custom column :

Date.From(List.Max([#"End time - date"])). 

I have a error message : capture error most date query power bi.PNG

 

 

capture error most date query power bi 2.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

first of all, the end date is of type DATE. I thought of copying the same value and the same type for a new column! ...

 

With this error, I must then add a type, in addition, in the formula to force a type like DATE for a new column.

How to do ?

 

Thank you in advance for your answer

 

 

1 ACCEPTED SOLUTION

Oh, what you want to use is a group operation:

Table.Group(PreviousStep, {"Number"}, {"Row", each Table.Max(_, "Date"), type record})

 

Then you would need to expand the Row column to get all the column values that are also in the row with the max date per number.

View solution in original post

3 REPLIES 3
artemus
Employee
Employee

You are refering to the max date for a single row, which won't work. What you want to do is the max date of all values in that column regardless of the current row.

 

Change:

Date.From(List.Max([#"End time - date"]))

to

Date.From(List.Max(#"Colonnes supprimées4"[#"End time - date"]))

Anonymous
Not applicable

Hi,

 

Thank you for your answer.

 

but I don't understand  that you want say...

My goal is for the extraction of record if the end date is max (latest as most recent) for each number.

for instance :

Number     Date

1                 2/01/2020

1                 3/01/2020

2                 2/01/2019

2                 1/01/2020

2                 2/01/2020

3                  null

4                 1/01/2020

4                 4/01/2020

 

Results :

 

Number     Date

1                 3/01/2020

2                 2/01/2020

3                  null

4                 4/01/2020

 

I hope you understand that I want say this ....

Oh, what you want to use is a group operation:

Table.Group(PreviousStep, {"Number"}, {"Row", each Table.Max(_, "Date"), type record})

 

Then you would need to expand the Row column to get all the column values that are also in the row with the max date per number.

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.

Top Solution Authors
Top Kudoed Authors