Forum Discussion

abc_777's avatar
abc_777
Solution Specialist
3 years ago

Hi

Hi,

 

I have following relation with

invtrackingsummary table and product_file

and 

profuct_stock and product_file

 

 

I want to take scanQTY column from invtrackingsummary table to product_stock table but its shows me wrong value 

 

my measure is 

 

1. inv_scanqty to Product_stock =
VAR _b =
    CALCULATE (
        MAX ('bm_retail_t invtrackingsummary'[ScanQty]),
        CROSSFILTER ('bm_retail_t product_stock'[BARCODE], 'bm_retail_t product_file'[BARCODE], Both )
    )
RETURN
    CALCULATE (
        _b,
        CROSSFILTER ( 'bm_retail_t invtrackingsummary'[Barcode], 'bm_retail_t product_file'[BARCODE], Both )
    )

 

please help me out

 

thanks

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi abc_777 ,

     

    More data is needed. Could you consider providing sanitized sample data and publishing the expected output?

     

    And check the following:

    In CROSSFILTER, the cross-filtering setting of a relationship is not important; that is, whether the relationship is set to filter one, or both directions in the model does not affect the usage of the function. CROSSFILTER will override any existing cross-filtering setting.

    An error is returned if any of the columns named as an argument is not part of a relationship or the arguments belong to different relationships.
    If CALCULATE expressions are nested, and more than one CALCULATE expression contains a CROSSFILTER function, then the innermost CROSSFILTER is the one that prevails in case of a conflict or ambiguity.

    The arguments OneWay_RightFiltersLeft and OneWay_LeftFiltersRight can be used in many-to-many and one-to-many relationship types, but not in the one-to-one relationship type.
    When the cross-filter type OneWay_RightFiltersLeft or OneWay_LeftFiltersRight is used in a one-to-many relationship type, it must be consistent with the only allowed filter propagation, which is one-to-many. If the requested direction is the opposite one, CROSSFILTER returns an error.

    CROSSFILTER only changes the cross filter direction applied when the relationship is active. CROSSFILTER does not change the active state of the relationship: USERELATIONSHIP must be used to activate an inactive relationship,.

    CROSSFILTER

     

    Best Regards,
    Gao

    Community Support Team

     

    If 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