Forum Discussion
Using a new column, compile a yes or no value for column A based on values in Column B
- Anonymous4 years ago
Try new column
new column =
var _cnt = calculate(distinctCOUNT(Table[Position]), Filter(Table, [Employee names] = earlier([Employee names]) && Table[Position] in {"Casual instructor", "Adjunct Instructor"} ))
return
if( not(isbalnk(_cnt)) && _cnt =2, "Yes", "No") - Anonymous4 years ago
Another Solution:
Hi, Here is an example on how to do this: Positions = var inspect = Inspector[Name] return If ( COUNTROWS ( FILTER ( ALL ( Inspector ), Inspector[Name] = inspect &&( Inspector[Position] = "A" || Inspector[Position] = "B" )))= 2 , "Yes" , "No" ) ...
Hi TheoC
Please see snip below:
Edgar, Ila is one of those employees is both a casual and adjunct instructor, hence she should appear as "Yes"
But when I generated the measure and calculated column using the query you gave me, here is what I see:
NB: Measure on the table is the measure I generated with your query
Column is also the calculated column I generated with the query you gave me
Please advise. Thanks.
Hi Anonymous
Sorry mate. I didn't realise you wanted to filter using slicers. Adjust the MEASURE to the following please and your output will be what you're after. We just need to add a CALCULATE and FILTER ALL to it like follows:
Measure =
VAR _1 = COUNTROWS ( 'Table' )
VAR _2 = CALCULATE ( SWITCH ( TRUE() , _1 < 2 , "No" , "Yes" ) , ALL ('Table' ) )
RETURN
_2
All the best with the journey!
Theo 🙂