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
kenmuir71
Helper I
Helper I

power bi lookup value previous date

Hi I cannot work out how to do the following in Power BI. I need to create a column with a value of the position of the previous day based on the product ID.

 

I have a large table of product IDs. Each date a product ID has a position. The position ID's are unique for each day, but the ProductID may be present in mutiple PositionID's, so are not unique.

 

So in the example below Product ID 5284 is in position 10019025 o the 5th Dec. I want the new column to return the position of the previous day for that product ID, which is 10019023. I have been attempting to achieve this with Lookup Value but with no success, any suggestions welcome! forum.PNG

 

 

1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@kenmuir71 

 

Column = CALCULATE(MAX(Sheet2[Position]),ALLEXCEPT(Table,Table[ProductID]),Table[Date]=EARLIER(Table[Date])-1)

 


Paul Zheng
Don't forget to hit THUMBS UP and mark it as a solution if it helps you!

View solution in original post

2 REPLIES 2
V-pazhen-msft
Community Support
Community Support

@kenmuir71 

 

Column = CALCULATE(MAX(Sheet2[Position]),ALLEXCEPT(Table,Table[ProductID]),Table[Date]=EARLIER(Table[Date])-1)

 


Paul Zheng
Don't forget to hit THUMBS UP and mark it as a solution if it helps you!

az38
Community Champion
Community Champion

Hi @kenmuir71 

try a column

Column = LOOKUPVALUE(Table1[Position];Table1[ProductId];Table1[ProductId];Table1[Date];Table1[Date]-1)

 

do not hesitate to give a kudo to useful posts and mark solutions as solution


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

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.