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.
I am looking to create a calculated column that returns the quote number that has the lowest price for each Opportinity.
I have 2 tables.
- Table 1 = Opportunities
- Unique Opportunity ID
- Table 2 = Quotes
- Each quote has a relationship to the Opportunity ID
Min Quote ID would be the calulated column.
Example Data
Table 1 | Table 2 | ||||
Opportunity ID | Min Quote ID | Quote ID | Quote Price | Opportunity ID | |
1 | ABC123 | ABC123 | 100 | 1 | |
2 | ABC126 | ABC124 | 200 | 1 | |
3 | ABC131 | ABC125 | 300 | 1 | |
4 | ABC132 | ABC126 | 50 | 2 | |
5 | ABC135 | ABC127 | 200 | 2 | |
ABC128 | 600 | 2 | |||
ABC129 | 600 | 3 | |||
ABC130 | 500 | 3 | |||
ABC131 | 200 | 3 | |||
ABC132 | 800 | 4 | |||
ABC133 | 900 | 4 | |||
ABC134 | 950 | 4 | |||
ABC135 | 100 | 5 | |||
ABC136 | 200 | 5 | |||
ABC137 | 300 | 5 |
Please let me if you have any ideas.
Thanks,
Chad
Solved! Go to Solution.
Hi,
Try these calculated column formulas in the Opportunities table
Minimum Price
=MINX(RELATEDTABLE(Quotes),Quotes[Quote Price])
Created date for minimum price
=CALCULATE(MAX(Quotes[Created]),FILTER(CALCULATETABLE(Quotes),Quotes[Opportunity ID]=[Opportunity ID]&&Quotes[Quote Price]=[Minimum price]))
Quote ID
=LOOKUPVALUE(Quotes[Quote ID],Quotes[Opportunity ID],[Opportunity ID],Quotes[Quote Price],MINX(RELATEDTABLE(Quotes),Quotes[Quote Price]),Quotes[Created],[Created date for minimum price])
This solution will work even if you have 100 for AB124
Hope this helps.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |