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! Learn more

Reply
Anonymous
Not applicable

grab a previous cell using an Index. The index is based off a unique order number.

I have an index for each order number as there is multiple entries for each. I want to grab the previous rows WCode.

 

Coglizer_1-1603372133276.png

 

This the DAX statement that I have been trying to use.

Test = VAR a = CALCULATE ( FIRSTNONBLANK('Gip700 Summary'[WCode]) FILTER( 'Gip700 Summary', 'Gip700 Summary'[Index]= EARLIER('Gip700 Summary'[Index]) && 'Gip700 Summary'[Order Number] = EARLIER('Gip700 Summary'[Order Number])) ) RETURN a

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Heres the solution to this.

Test = IF('Gip700 Summary'[Order Number]='Gip700 Summary'[Order Number],LOOKUPVALUE('Gip700 Summary'[WCode],'Gip700 Summary'[Index],'Gip700 Summary'[Index]+1))

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Heres the solution to this.

Test = IF('Gip700 Summary'[Order Number]='Gip700 Summary'[Order Number],LOOKUPVALUE('Gip700 Summary'[WCode],'Gip700 Summary'[Index],'Gip700 Summary'[Index]+1))
Anonymous
Not applicable

Hi, you could use powerquery to replace zeroes with null and then fill down the column, would that work?  You could order data in by index first 

 

Dan

Anonymous
Not applicable

Test = VAR a = CALCULATE ( FIRSTNONBLANK('Gip700 Summary'[WCode]) FILTER( 'Gip700 Summary', 'Gip700 Summary'[Index]= EARLIER('Gip700 Summary'[Index]) && 'Gip700 Summary'[Order Number] = EARLIER('Gip700 Summary'[Order Number])) ) RETURN a

 This the DAX that I have been trying to work with.

Anonymous
Not applicable

I wouldn't be able to do that as zero is a code that I would need for a seperate column after I can get the test column completed

Anonymous
Not applicable

You could duplicate the column if you need the zeroes

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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