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
tangytang
Regular Visitor

Lookup returning blanks

 Hello PBI,

 

Ive been trying to resolve my lookup issue by following this article.

 

My objective is to display the RemainingQuantity from the previous day as the OpeningQuantity for this day.

 

First, I ranked the dates with:

Rank = RANKX(ConsolidatedQuery_v3,ConsolidatedQuery_v3[Date],,ASC)

 

Then, I performed a lookup where:

OpeningQuantity = LOOKUPVALUE(ConsolidatedQuery_v3[RemainingQuantity],ConsolidatedQuery_v3[Rank],ConsolidatedQuery_v3[Rank]-1)

 

Without the OpeningQuantity, the data looks like so:

noopen.png

 

However, once i add the "Opening Data", the table turns blank:

 

withopen.png


I suspect this may due to the fact that I have multiple Branches. For example, Branch "BJ" might have quantities recorded everyday between 01/01/16 to 01/01/17.

 

Similarly, Branch "VC" might have quantities recorded everyday between 01/01/16 to 01/01/17. Therefore a particularly date like 03/03/16 can appear twice.

 

But I am not sure. If anyone could help me, that'll be great! 🙂

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

Hi tangytang,

 

[Rank] and [OpeningQuantity] are both calculate columns, right? I have tested on your issue but they work well on my side, see screenshot below:

1.PNG 

Please refer to PBIX file here: https://www.dropbox.com/s/b9mgv7q255zicvu/Lookup%20returning%20blanks.pbix?dl=0.

 

Regards,

Jimmy Tao

View solution in original post

1 REPLY 1
v-yuta-msft
Community Support
Community Support

Hi tangytang,

 

[Rank] and [OpeningQuantity] are both calculate columns, right? I have tested on your issue but they work well on my side, see screenshot below:

1.PNG 

Please refer to PBIX file here: https://www.dropbox.com/s/b9mgv7q255zicvu/Lookup%20returning%20blanks.pbix?dl=0.

 

Regards,

Jimmy Tao

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.