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
Maricon
Frequent Visitor

Get the latest value of table 1 to table 2 with parameteres/condtions

Hi, Can you help me solve my issue- what measure or calculated column should I use. I wanted to input the latest price from Table 2 to Table 1, but need to make sure its the same group, same item code. See my sample, table 1 column price, thats the value I wanted to show in my measure or column. Thanks you in advance

 

Capture3.JPG

1 ACCEPTED SOLUTION

Hi @Maricon ,

 

Please refer to my .pbix file.

v-lionel-msft_0-1594805019161.png

 

Best regards,
Lionel Chen

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

 

 

View solution in original post

6 REPLIES 6
v-lionel-msft
Community Support
Community Support

Hi @Maricon ,

 

You just need to import 'Table 2' and creates a calculated table(Please refer to my .pbix file.).

t1.PNG

 

Best regards,
Lionel Chen

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

 

 

amitchandak
Super User
Super User

@Maricon , Create a new column in Table 1

lastest price = maxx(filter(Table2,Table2[item code] =Table1[item code] && Table2[Group] =Table1[Group]),lastnonblankvalue(Table1[pricedate],max(price)))

@amitchandakThanks, Maybe I didnt explained well. 

 

The price should be the latest for each year. If today is 2020, latest price for 2020, and if no price for 2020, show the last price before the order date. Thanks again in advance

@Maricon , last nonblank will take latest data from 2020 if present, if not then from 2019, That should work. If not.

Can you share sample data and sample output in table format?

@amitchandak @v-lionel-msft  thanks for checking-- i tride both your solution and still not showing what I want. 

Let me change the data sample--see below.

 

In below table, Both your solution resulted to same value,  Price V1 - I used @amitchandak recommended solution and Price V2 I used @v-lionel-msft recommended solution.

This is what I wanted to see :

All 2018 dates should be 3,047.63 , 2019 dates should be 2585.38 & 2020 date shld be 2461. Hope you can help me. Thanks in advance.

Capture5.JPG

here below are my tables

 

Order Date ItemGroup
16/04/2018 0:00123AAA
18/04/2018 0:00123AAA
04/07/2018 0:00123AAA
06/08/2018 0:00123AAA
30/08/2018 0:00123AAA
17/01/2019 0:00123AAA
25/01/2019 0:00123AAA
01/02/2019 0:00123AAA
21/05/2019 0:00123AAA
22/08/2019 0:00123AAA
29/08/2019 0:00123AAA
29/10/2019 0:00123AAA
06/11/2019 0:00123AAA
19/02/2020 0:00123AAA
23/03/2020 0:00123AAA

 

 

 

GroupPrice DateItemPrice
AAA13/01/2014 9:321233487.77
AAA03/10/2014 8:371233427.272
AAA06/10/2015 11:141233282.222
AAA10/03/2016 3:481233038.08
AAA05/10/2016 14:331234633.88
AAA12/01/2018 3:591233047.625
AAA30/01/2019 12:061232585.375
AAA01/02/2020 8:331232461
    

Hi @Maricon ,

 

Please refer to my .pbix file.

v-lionel-msft_0-1594805019161.png

 

Best regards,
Lionel Chen

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

 

 

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.