Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
abc_777
Super User
Super User

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))
 
abc_777_0-1687279740860.png

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

0 REPLIES 0

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.