Forum Discussion
When any row in a column equals True, return True
- 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
Hi Siva,
Thanks for helping out. Sorry for not being clear on this.
A Customer can be seen as a separate company. Every customer/company has multiple users. Those users can be active or inactive.
I have a dataset that tells me for every user whether they are active or not, and what customer they are working for.
What I now want to know for each customer is whether these customers have at least 1 active user or not.
Cheers
Bas
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
- Anonymous8 years agoNot applicable
Thanks! I've tried it out but I'm getting an error on the EARLIER function.
In my example I gave the CustomerID and the UserID a number, but in fact they are text based. What should I replace the EARLIER function with?
- PattemManohar8 years ago
Community Champion
Please post tthe screenshot of the error you are facing...
- Anonymous8 years agoNot applicable
I had to change "true" to true() because its a boolean columnBut when doing that I get this 'expressions that yield variant data-type cannot be used to define calculated columns