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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
rbpercussion
Regular Visitor

Create a column with rows based on earliest value in another column

I have the below table and want to create a column that has the first value of weight (152.6) for every row.  I plan on using this to create another measure that shows % increase decrease over time

 

What is the easiest way to do this?

 

Thanks for your help

 

DateTimeWeight
1/29/202311:59:00 AM152.6
1/29/20236:44:00 PM153
1/30/20237:48:00 AM152.8
1/30/20238:45:00 PM151.4
1/31/20236:34:00 AM150.8
1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Write these calculated column formulas

Date time = Data[Date]+Data[Time]
First weight = LOOKUPVALUE(Data[Weight],Data[Date time],CALCULATE(MIN(Data[Date time]),ALL(Data)))

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

10 REPLIES 10
rbpercussion
Regular Visitor

@Ashish_Mathur this worked!  thank you!

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

Write these calculated column formulas

Date time = Data[Date]+Data[Time]
First weight = LOOKUPVALUE(Data[Weight],Data[Date time],CALCULATE(MIN(Data[Date time]),ALL(Data)))

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
hummingbird
Helper II
Helper II

Hi, 

 

You could try something like this. Although I would suggest linking the "earliestWeight" to "Time" column, so you get the true first value, rather than just the minimum results from the "Weight" column.

 

 

Average Weight = 
VAR earliestWeight = CALCULATE (
    MIN ( 'Table'[Weight] ),
    FILTER ( 'Table', 'Table'[Date] = MIN ( 'Table'[Date] ) )
) 
RETURN CALCULATE(AVERAGE( 'Table'[Weight]), ALLEXCEPT('Table','Table'[Date])) / earliestWeight

 

hummingbird_1-1676194267094.png

 


 

@rbpercussion Does that answer your question? Mark it as a solution! 

rbpercussion
Regular Visitor

This is my desired output in column D and how I would write it in excel:

rbpercussion_0-1676138565895.png

 

serpiva64
Solution Sage
Solution Sage

Hi,

you can try 

Measure = CALCULATE(sum('Table'[Weight]), INDEX(1,ORDERBY('Table'[Merged])))

serpiva64_0-1676135586097.png

 

Column D is my desired output and how I would write it in excel:

 

rbpercussion_0-1676138459020.png

 

Greg_Deckler
Community Champion
Community Champion

@rbpercussion Try:

Column = MINX(ALL('Table'),[Weight])


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Hi @Greg_Deckler ,

That returns the minimum weight for the table.  What I am trying to return is the weight that corresponds to the earliest date

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors