Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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.
| Part Number | Transaction Date | SOH (measure) | Required result |
| AA | 01 January 2019 | 32 | |
| AA | 15 January 2019 | 55 | 32 |
| AA | 17 January 2019 | 75 | 55 |
| AA | 04 February 2019 | 61 | 75 |
| AA | 05 February 2019 | 51 | 61 |
| AA | 06 February 2019 | 41 | 51 |
| BB | 06 February 2019 | 20 | 0 |
| BB | 07 February 2019 | 20 | 20 |
Thank you,
Solved! Go to Solution.
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))
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))
It works perfectly, thank you ![]()
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 93 | |
| 81 | |
| 73 | |
| 46 | |
| 35 |