March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hello everyone!
I'm working with 2 tables: The first one has all the information about the products, including the product_id. The second one has the information of the orders that my store has received, including the product_id and price. I'm trying to compare both tables, using column product_id, and bring the price from the second table to the first, I see this error message:
We cannot determine a single value for column 'product_id' in the 'olist_products_dataset' table. This can occur when a measure formula references a column that contains many values without specifying an aggregation, such as min, max, count, or sum, to obtain a single result.
Here's the formula I'm using:
Solved! Go to Solution.
@ryan_mayu Thanks for your prompt reply!
Please consider using an aggregation function to derive a single price value. For example, you might want to use the average, minimum, or maximum price.Here's how you could modify your measure to use the average, minimum, or maximum price.
AVERAGE
Measure 3 =
AVERAGEX(
FILTER(
olist_order_items_dataset,
olist_order_items_dataset[product_id] = olist_products_dataset[product_id]
),
olist_order_items_dataset[price]
)
MAX
Measure 3 =
MAXX(
FILTER(
olist_order_items_dataset,
olist_order_items_dataset[product_id] = olist_products_dataset[product_id]
),
olist_order_items_dataset[price]
)
MIN
Measure 3 =
MINX(
FILTER(
olist_order_items_dataset,
olist_order_items_dataset[product_id] = olist_products_dataset[product_id]
),
olist_order_items_dataset[price]
)
Best Regards,
Jayleny
@ryan_mayu Thanks for your prompt reply!
Please consider using an aggregation function to derive a single price value. For example, you might want to use the average, minimum, or maximum price.Here's how you could modify your measure to use the average, minimum, or maximum price.
AVERAGE
Measure 3 =
AVERAGEX(
FILTER(
olist_order_items_dataset,
olist_order_items_dataset[product_id] = olist_products_dataset[product_id]
),
olist_order_items_dataset[price]
)
MAX
Measure 3 =
MAXX(
FILTER(
olist_order_items_dataset,
olist_order_items_dataset[product_id] = olist_products_dataset[product_id]
),
olist_order_items_dataset[price]
)
MIN
Measure 3 =
MINX(
FILTER(
olist_order_items_dataset,
olist_order_items_dataset[product_id] = olist_products_dataset[product_id]
),
olist_order_items_dataset[price]
)
Best Regards,
Jayleny
that means one product_id can find different prices in the second table, so can't determine which price to take. pls share the sample data and expected output. Maybe we can use other formula to solve this.
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
132 | |
90 | |
88 | |
64 | |
58 |
User | Count |
---|---|
203 | |
141 | |
107 | |
73 | |
70 |