Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Broly221
Frequent Visitor

Copy latest row value in entire column

Hi,

 

I have a table with a date column. I want to create a new column that will look at the latest "Brand" value and put it in the entire column. in this case : latest value is 1 feb 23 therefore we should put "AAA" in the entire column.

Broly221_0-1677018420341.png

How can in please achieve that ?

thanks 

1 ACCEPTED SOLUTION
olgad
Super User
Super User

Hi,
measure, not column

Latest Barnd Value = Calculate(
    Calculate(max(Table[Brand]), Filter(Table, Table[CreationDate]=Max(Table[CreationDate])))
,All(Table))

DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

View solution in original post

4 REPLIES 4
Broly221
Frequent Visitor

thanks for your help !

Len_Barr
Resolver I
Resolver I

As Olga said, use a measure, not a column

 

I'd do it differently though. 

 

FIRST OF ALL, disable auto time detection - otherwise the last date is going to be way later than your actual date. 

File - options and settings - options - current file - data load - time intelligence - unclick "Auto date/time for new.."

 

Then use this in a MEASURE. You may have to change the table/column names to fit your data. 

Lookuplast =

VAR Last = MAX('Table'[Datecolumn])

RETURN

LOOKUPVALUE('Table'[Brand], 'Table'[Datecolumn], [Last])

thank you !

olgad
Super User
Super User

Hi,
measure, not column

Latest Barnd Value = Calculate(
    Calculate(max(Table[Brand]), Filter(Table, Table[CreationDate]=Max(Table[CreationDate])))
,All(Table))

DID I ANSWER YOUR QUESTION? PLEASE MARK MY POST AS A SOLUTION! APPRECIATE YOUR KUDO/LIKE!
PROUD TO BE A SUPER USER!
Best Stories, Interesting Cases: PowerBI Storytime Newsletter
Linkedin Profile: Linkedin
YouTube Channel: PowerBI Storytime

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.