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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Anonymous
Not applicable

Return value if value appears after date in second table

Hey, 

 

I have an interesting problem that I cannot seem to wrap my mind around. 

Basically, I have two different tables with the same order numbers. One table(Table1) declares what is being put in an order, while the second table(Table2) declares when that order has been finished. 

However, the problem is when a part of an order gets added to table1 after the order has been finished in table2. (This often happens when an item (or several) are not in stock, but get in stock later etc.).

 

So what I would like, is to add an "-1" or something similar in Table 1 after the order number, to indicate that the order has been finished one time (or more). 

 

The tables look like this; 

 

Table 1 (with desired result)

Sgb1201_1-1673513529069.png

Ideally it should be able to add -1, -2, -3, etc. if there are more than 2 occurences in table 2. 

 

Table 2: 

Sgb1201_2-1673513674185.png

Any help is appreciated! 
Let me know if something is unclear, etc. 

Thanks. 

2 REPLIES 2
v-shex-msft
Community Support
Community Support

HI @Anonymous,

I check the two table records but can't find the unique field to mapping two table detailed records for Dax formula coding. Can you please share more detail information about these?

How to Get Your Question Answered Quickly  

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

Hi @v-shex-msft,

Thanks for the reply. 

 

Do you mean the unique identifier for the two tables? The OrderNumber columns are the ones linking the two tables. 

Let me show you a better example; (Table1)

Sgb1201_3-1673591051914.png

Table2;

Sgb1201_9-1673594537111.png

The only relevant columns are the green ones. So if there are any occurences of a value in the OrderNumber column (Table1) with a later transaction date (Table 1) than in the first ErrorDate (table 2) for the same OrderNumber, the OrderNumber should get a "-1" at the end of the OrderNumber (see DesiredResult / Value2 column).

 

I hope that helped clear things up a bit. 

 

 

 

 

 

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 MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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