Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi everyone,
I have two tables connected in a many-to-many relationship. Their key might be the concatenation of the fields 'art_cod,' 'client_code,' and 'price.' I need to add a column in 't1' whose value is the nearest (the value of date in t2 must be after that of t1, and in case of multiple rows, it should take the min date) date in the 'date' column of 't2,' and the columns 'art_cod,' 'client_code,' and 'price' should match (or the key, which is their concatenation).
Thanks a lot!
Solved! Go to Solution.
Hi @BI_user2023 ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create a calculated column in table1.
date2 = CALCULATE(MIN('T2'[date]),FILTER('T2','T2'[art_cod]=EARLIER('T1'[art_cod])&& 'T2'[client_code]=EARLIER('T1'[client_code]) && 'T2'[price]=EARLIER(T1[price]) && 'T2'[date] >EARLIER('T1'[date])))
(3) Then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @BI_user2023 ,
According to your description, here are my steps you can follow as a solution.
(1) My test data is the same as yours.
(2) We can create a calculated column in table1.
date2 = CALCULATE(MIN('T2'[date]),FILTER('T2','T2'[art_cod]=EARLIER('T1'[art_cod])&& 'T2'[client_code]=EARLIER('T1'[client_code]) && 'T2'[price]=EARLIER(T1[price]) && 'T2'[date] >EARLIER('T1'[date])))
(3) Then the result is as follows.
If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
User | Count |
---|---|
13 | |
8 | |
8 | |
7 | |
5 |
User | Count |
---|---|
21 | |
15 | |
15 | |
10 | |
7 |