Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi guys, I am having some trouble using the LOOKUP DAX command as it is returning more than 1 value when I use it. I have products that are sold under a contract name and I am trying to match the sales data to these contract names where possible. The problem I am having however is that I have multiple contracts that have the same products tied to them but represent various years.
For example:
CONTRACT NAMES PRODUCT EFFECTIVE DATE EXPIRY DATE
DAY TO DAY NETS 2020/2021 3 January 1 2020 Dec 31 2020
DAY TO DAY NETS 2019/2020 3 January 1 2019 Dec 31 2019
DAY TO DAY NETS 2018/2019 3 January 1 2018 Dec 31 2018
Is there any way I can reference these effective and expiry dates to lookup the correct contract name based on specific products??
=VAR vProduct=MAX(Product[Product]) VAR vDate=MAX(Product[Date]) RETURN CALCULATE(MAX(Contracts[Contract Names]),FILTER(Contracts,Contracts[Product]=vProduct&&Contracts[Effective date]<=vDate&&Contracts[Expire date]>=vDate))
Would you be able to provide sample data for the table with sales data, as well as the expected result? Actual table and column names will make it easier to copy the solution into your pbix.
Proud to be a Super User!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 22 | |
| 12 | |
| 10 | |
| 10 | |
| 9 |