Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Creating an Exclusion Indicator Column Based on Combination Values from an Exclusion Table

Hi, I want to create a column that indicates exclusion based on the combination of values in the exclusion table (Sheet1). The exclusion table contains various combinations of field values, such as L...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Anonymous ,
    Unfortunately I can't open your pbix file due to environment constraints, happily I created the instance dataset based on your image and when I was using the Lookvalue function it didn't handle the context well either, so a different way of thinking will achieve what you need, hope my method is helpful!

    ExcludeFlag = 
    VAR KeyTable1 =
       TABLE1[ACTIVITY] & "_" &
       TABLE1[WAREHOUSE_NO] & "_" &
       TABLE1[CONFIRM_NAME] & "_" &
       TABLE1[LOADING_GRP_CD] & "_" &
       TABLE1[MATERIAL_GRP_CD]
    VAR MatchFound =
       LOOKUPVALUE(
           Sheet1[CONFIRM_NAME],
           Sheet1[ACTIVITY], TABLE1[ACTIVITY],
           Sheet1[WAREHOUSE_NO], TABLE1[WAREHOUSE_NO],
           Sheet1[CONFIRM_NAME], TABLE1[CONFIRM_NAME],
           Sheet1[LOADING_GRP_CD], TABLE1[LOADING_GRP_CD],
           Sheet1[MATERIAL_GRP_CD], TABLE1[MATERIAL_GRP_CD]
       )
    RETURN
    IF(
       NOT(ISBLANK(MatchFound)),
       "Exclude",
       "Include"
    )

    I would be honoured if my solution could solve your problem!

    Hope it helps!

     

    Best regards,
    Community Support Team_ Tom Shen

     

    If this post helps then please consider Accept it as the solution to help the other members find it more quickly.