Forum Discussion
ells69
3 years agoHelper I
Pattern for getting a value from another fact table based on value from current table
I have two trimmed down fact tables and two dimension tables. The dimesnion tables filter both fact tables. For my inventory (fact) table I want to retrieve the order id from the orders table. In ...
- 3 years ago
Hi ells69
You may try with TREATAS. It is not usually super fast but it could improve the performance in some scenarios.OrderID = IF ( HASONEVALUE ( 'inventory'[Key_Product_businessUnit] ), CALCULATE ( MAX ( 'Orders'[OrderID] ), TREATAS ( VALUES ( 'inventory'[Key_Product_businessUnit] ), 'Orders'[Key_Product_businessUnit] ) ) )
tamerj1
3 years agoCommunity Champion
Hi ells69
You may try with TREATAS. It is not usually super fast but it could improve the performance in some scenarios.
OrderID =
IF (
HASONEVALUE ( 'inventory'[Key_Product_businessUnit] ),
CALCULATE (
MAX ( 'Orders'[OrderID] ),
TREATAS (
VALUES ( 'inventory'[Key_Product_businessUnit] ),
'Orders'[Key_Product_businessUnit]
)
)
)