Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi,
I want to lookup Price column into another table with latest date value only when matches the itemno
please help me how to write lookup formula
Solved! Go to Solution.
Hi @sprao
From your data, one item may have multiple prices on a date. If I understand it correctly, your original Items table is in an order that the price on the top is the earliest value and the price on the bottom is the latest value on the same date, right? With this logic, you can use Power Query Editor to add an Index column first,
Then go to Power BI Desktop, create a calculated table with below DAX:
Price Table =
SUMMARIZE (
ItemsTable,
ItemsTable[Item No],
"Price",
CALCULATE (
MAX ( ItemsTable[Price] ),
ItemsTable[Index] = MAX ( ItemsTable[Index] )
)
)
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
@sprao , what happen when that date is not there, assum you can take the next date
New column in item Table
Price new =
var _max = Minx(filter(Price,Price[Itemno] = item[ItemNo] && Price[Date]>= item[Date]) , price[Date])
return
Minx(filter(Price,Price[Itemno] = item[ItemNo] && Price[Date]=_max) , price[Price])
sorry i price table dont have Date column, i just kept understanding purpose
Hi @sprao
From your data, one item may have multiple prices on a date. If I understand it correctly, your original Items table is in an order that the price on the top is the earliest value and the price on the bottom is the latest value on the same date, right? With this logic, you can use Power Query Editor to add an Index column first,
Then go to Power BI Desktop, create a calculated table with below DAX:
Price Table =
SUMMARIZE (
ItemsTable,
ItemsTable[Item No],
"Price",
CALCULATE (
MAX ( ItemsTable[Price] ),
ItemsTable[Index] = MAX ( ItemsTable[Index] )
)
)
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
82 | |
81 | |
52 | |
39 | |
35 |
User | Count |
---|---|
95 | |
79 | |
52 | |
49 | |
47 |