Forum Discussion

abc_777's avatar
abc_777
Icon for Solution Specialist rankSolution Specialist
3 years ago

hi

Hello,

 

i am doing produt cross selling so i have one one part which is to compaire

'bm_retail_t product_file'[ITEM_NAME] and 
 'Product File (Filter Table)'[ITEM_NAME]
 
Customer purchased test =

IF (
    HASONEVALUE ('bm_retail_t product_file'[ITEM_NAME])
        && HASONEVALUE ( 'Product File (Filter Table)'[ITEM_NAME] ),
    IF (
        VALUES ('bm_retail_t product_file'[ITEM_NAME])
            = VALUES ( 'Product File (Filter Table)'[ITEM_NAME] ),
        TRUE
    )
)
 
THEN
 
Customer Who bought Quantity =
IF([Customer purchased test],
BLANK(),
    [Total in Piece and KG (Measure)])
 
and then
 
Customers w/both Products Quantity =
VAR MultiPurchaseEvaluation =
    CALCULATETABLE(VALUES('bm_retail_t sale'[customer index to Sale]),
        ALL('bm_retail_t product_file'),
        USERELATIONSHIP('bm_retail_t sale'[Product index to sale], 'Product File (Filter Table)'[Product_file Index]))

RETURN
    IF([Customer purchased test] = TRUE,
        BLANK(),
            Calculate([Customer Who bought Quantity], MultiPurchaseEvaluation))
 
here i got quantity as per 'bm_retail_t product_file'[ITEM_NAME]
 
Same was i want to see product quantity by  'Product File (Filter Table)'[ITEM_NAME] and so i did
 
Customer purchased test2 =

IF (
    HASONEVALUE ('Product File (Filter Table)'[ITEM_NAME])
        && HASONEVALUE ( 'bm_retail_t product_file'[ITEM_NAME] ),
    IF (
        VALUES ('Product File (Filter Table)'[ITEM_NAME])
            = VALUES ( 'bm_retail_t product_file'[ITEM_NAME]),
        TRUE
    )
)
 
then 
 
Customer Who bought Quantity2 =
IF([Customer purchased test2],
BLANK(),
    [Total in Piece and KG (Measure)])
 
and then 
 
Customers w/both Products_filter Quantity =
VAR MultiPurchaseEvaluation =
    CALCULATETABLE(VALUES('bm_retail_t sale'[customer index to Sale]),
        ALL('Product File (Filter Table)'),
        USERELATIONSHIP('Product File (Filter Table)'[Product_file Index], 'bm_retail_t sale'[Product index to sale]))

RETURN
    IF([Customer purchased test2] = TRUE,
        BLANK(),
            Calculate([Customer Who bought Quantity2], MultiPurchaseEvaluation))
 

here first Item_name is comming from 'bm_retail_t product_file'[ITEM_NAME] and second Item_name comming from  'Product File (Filter Table)'[ITEM_NAME]

 

but both quantity is same. 

 

can some one please correct my measure so i can get quantity as per two different tables

 

its really a complex report. if some one can help me out

 

thanks

No RepliesBe the first to reply