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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
vrossouw
Helper III
Helper III

Info from previous row if result was measure

Hi

I want to write a measure to find the result from a measure from a previous row, by date and part number.

The SOH column is the result of a measure.

The required result must also be a measure, reading from the previous row, by date and by part.

Spoiler
Part NumberTransaction DateSOH (measure)Required result
AA01 January 201932 
AA15 January 20195532
AA17 January 20197555
AA04 February 20196175
AA05 February 20195161
AA06 February 20194151
BB06 February 2019200
BB07 February 20192020

Thank you,

 

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @vrossouw 

Create a calculated column

RANK = RANKX(FILTER('Table','Table'[Part Number]=EARLIER('Table'[Part Number])),[Transaction Date],,ASC,Dense)

Create a measure

Measure 2 = CALCULATE([Measure],FILTER(ALLEXCEPT('Table','Table'[Part Number]),'Table'[RANK]=MAX('Table'[RANK])-1))

Capture2.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @vrossouw 

Create a calculated column

RANK = RANKX(FILTER('Table','Table'[Part Number]=EARLIER('Table'[Part Number])),[Transaction Date],,ASC,Dense)

Create a measure

Measure 2 = CALCULATE([Measure],FILTER(ALLEXCEPT('Table','Table'[Part Number]),'Table'[RANK]=MAX('Table'[RANK])-1))

Capture2.JPG

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

It works perfectly, thank you Smiley Very Happy

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors