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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
khisla
Frequent Visitor

X Lookup within same table

Hello Community

I have the below data columns withiin my table and need to get the below result (i.e. original receipt date column).

I need to x-lookup the retrieved from receipt no. within the receipt no column in order to get the date.  

Want to insert a new column with the date of the receipt no. which is located as another column within the same table.

 

Receipt No.Date Gross Amount (excl. VAT)  Net Amount (excl. VAT) Sale Is Return SaleRetrieved from Receipt No.Orignal Receipt Date
000IL135010001782681/9/2025                            -                        -  TRUE000IL135010001609011/21/2025
000IL135010001758981/14/2025                       427                 299TRUE000IL135010001609011/21/2025
000IL135010001774121/2/2025                            -                        -  TRUE000IL135010001770221/2/2025
000IL135010001773281/2/2025                       641                 449TRUE  
000IL135010001770221/2/2025                            -                        -  TRUE000IL13501000178268 
000IL135010001812511/6/2025                  1,197                 718TRUE000IL135010001758981/14/2025
000IL135010001828001/21/2025                       427                 496TRUE000IL135010001774121/2/2025
000IL135010001609011/21/2025                       154                 108TRUE000IL135010001773281/2/2025
000IL135010001773311/26/2025                            -                        -  TRUE000IL135010001773311/26/2025

 

Thanks in advance!!

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@khisla 
Add the following Calculated Column to your table, rename the table as per your model":

Orignal Receipt Date = 

VAR __Rno = Table02[Retrieved from Receipt No.]
VAR __Date = MAXX( FILTER( Table02 , Table02[Receipt No.] = __Rno ) , Table02[Date] )
RETURN
    __Date

 

Fowmy_0-1739098961303.png

 

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

3 REPLIES 3
quantumudit
Super User
Super User

Hello @khisla 

I hope I have correctly understood your query and appreciate the provided sample dataset.

 

Below is the DAX formula to create a calculated column that performs a lookup within the same table to retrieve the corresponding date based on the given receipt number.

 

Orignal Receipt Date - Calculated = LOOKUPVALUE('Table'[Date],'Table'[Receipt No.],'Table'[Retrieved from Receipt No.])

 

Here is the screenshot where you can review the "Expected Original Receipt Date" column and the one made with the DAX calculation, so that you can easily compare the results with the expected ones.

 

quantumudit_0-1739099135892.png

 

I am also attaching the Power BI file for your reference. Please let me know if you need any further information.

 

Best Regards,
Udit

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudo 👍

🚀 Let's Connect: LinkedIn || YouTube || Medium || GitHub
Visit My Linktree: LinkTree

 

Proud to be a SuperUser

 

 

 

 

 

 

Hello @khisla

I would appreciate your feedback on whether the DAX formula I provided as part of the solution to your query is functioning correctly. Please inform me if it is not working.

 

Thanks, 

Udit

Fowmy
Super User
Super User

@khisla 
Add the following Calculated Column to your table, rename the table as per your model":

Orignal Receipt Date = 

VAR __Rno = Table02[Retrieved from Receipt No.]
VAR __Date = MAXX( FILTER( Table02 , Table02[Receipt No.] = __Rno ) , Table02[Date] )
RETURN
    __Date

 

Fowmy_0-1739098961303.png

 

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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