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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
CrisCros23
Frequent Visitor

Lookup column

Hi All,

In order to identify new documents posted during a month, I want to compare values of these documents between two dates.
In my Table i have :
One column "Dates" -> Format (dd.mm.yy)
One column "Doc number" -> Format Text
One column "Amount $" -> Format Number
To know if my document number is a new entry of last month, I want to create one column that will return "YES" if when doing a vlookup of document number under previous date (here 30.06.22) it returns an error or a nil value. Else column should return "NO"

I tried with Lookupvalue but this does not fit with Text nor Date format columns.

Thank you

CrisCros23_0-1661512614705.png
Expected column answers regarding Doc Nb :
14 and 37 -> "NO"
38, 39 and 40 -> "YES"

2 REPLIES 2
Anonymous
Not applicable

Hi @CrisCros23 ,

 

The screenshot you provided is from Power BI Desktop. Do you want to use the DAX implementation in Power BI Desktop or the M implementation in Power Query?

I would recommend to add a column that contains the value from the previous row. Then you can write out your logic for the new column with references to the current row only.
If performance matters, you have to use this function to retrieve the value from the previous row: 
Fast and easy way to reference previous or next rows in Power Query or Power BI – The BIccount...

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. I can only help you with meaningful sample data.
Please paste the data into a table in your post or use one of the file services like OneDrive or Google Drive.
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...

Please show the expected outcome based on the sample data you provided. Screenshots of the expected outcome are ok.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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