Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon'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.
Hello Team,
I need help creating a new column in a table.
My tables are as follows:
Table Stock_main:
Date | Description | Balance |
28/01/2022 | Sugar | 5.00 |
28/01/2022 | Sugar | 4.00 |
28/01/2022 | Soda | 3.00 |
27/01/2022 | Chicken | 7.00 |
26/01/2022 | Chicken | 5.00 |
Purchasing table:
Date | des | Unit price |
03/01/2022 | Sugar | 10.00 |
01/01/2022 | Sugar | 8.00 |
01/01/2022 | Soda | 15.00 |
01/01/2022 | Chicken | 100.00 |
31/12/2022 | Chicken | 110.00 |
I need to vlookup the latest unit price in the table Stock_main from the purchasing table.
I appreciate your help.
Kind Regards,
Hasvine
Solved! Go to Solution.
@Anonymous , a new column in Stock_main
MAxx(filter(Purchasing, Purchasing[des] =Stock_main[Description] && Purchasing[Date] <=Stock_main[Date]) ,Purchasing[Date] )
Hi @Anonymous ,
It required bit of modelling where you need to create a calender table and join these table with it.
Then create a column as below:-
latest_unit_Price =
VAR _max_date =
CALCULATE (
MAX ( 'Purchasing table'[Date] ),
FILTER (
'Purchasing table',
'Purchasing table'[description] = Stock_main[Description]
)
)
RETURN
CALCULATE (
SELECTEDVALUE ( 'Purchasing table'[Unit price] ),
FILTER ( 'Purchasing table', 'Purchasing table'[Date] = _max_date )
)
Refer a file below:-
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Hi @Anonymous ,
It required bit of modelling where you need to create a calender table and join these table with it.
Then create a column as below:-
latest_unit_Price =
VAR _max_date =
CALCULATE (
MAX ( 'Purchasing table'[Date] ),
FILTER (
'Purchasing table',
'Purchasing table'[description] = Stock_main[Description]
)
)
RETURN
CALCULATE (
SELECTEDVALUE ( 'Purchasing table'[Unit price] ),
FILTER ( 'Purchasing table', 'Purchasing table'[Date] = _max_date )
)
Refer a file below:-
Best Regards,
Samarth
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
144 | |
75 | |
63 | |
51 | |
48 |
User | Count |
---|---|
211 | |
86 | |
64 | |
59 | |
56 |