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

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 @Sgb1201,

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.

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
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.