Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

When any row in a column equals True, return True

Hi there, I have a database with a unique user ID, a customer ID and a column showing the user is active.    User ID Customer ID User is Active 1 1 FALSE 2 1 FALSE 3 2 FALSE ...
  • PattemManohar's avatar
    PattemManohar
    8 years ago

    Could you please add a new column in "Data" pane as below:

     

    CustomerActive =
    VAR _TrueVal = SELECTCOLUMNS(FILTER(ALL(UserCustomer),UserCustomer[UserActive]="True" && UserCustomer[CustomerID] = EARLIER([CustomerID])),"UserActive",UserCustomer[UserActive])
    RETURN IF(ISBLANK(_TrueVal),"FALSE",_TrueVal)

     

    Here is the expected output as per the sample data provided...

     

    Output