Forum Discussion
Return Value from another table[column] based on weight
- Anonymous3 years ago
Hi Hussain_R ,
Please new a calculated column in Customer Table:
Lookup Value = VAR _cust_id = 'Customer'[Cust_ID] VAR _table = CALCULATETABLE ( VALUES ( 'Fact'[Prod_ID] ), 'Fact'[Cust_ID] = _cust_id ) VAR _max_cate = CALCULATE ( MAX ( 'Product'[Cate] ), 'Product'[Prod_ID] IN _table ) VAR _prod_id = CALCULATE ( MAX ( 'Product'[Prod_ID] ), 'Product'[Cate] = _max_cate ) RETURN _prod_idBest Regards,
Gao
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data
Hi Hussain,
Please find the code
Wouldn't I be comparing the text data with integer as the product ID is type text and PBI throw an error?
Edit: It does. It says:
DAX comparison operations do not support comparing values of type Integer with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values
- Anonymous3 years agoNot applicable
It sent me no error. I builyt a file with your datas and it works