Forum Discussion
Syndicate_Admin
2 years agoAdministrator
Compare Two Columns
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...
- Anonymous2 years ago
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
2 years agoSuper User
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.