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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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))
danno
Resolver V
Resolver V

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

You could duplicate the column if you need the zeroes

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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