Forum Discussion
Unique Values with Multiple Conditions
- 4 years ago
Hi Anonymous
You can add a column with below DAX. Modify table name per your need. Power BI does not support merging cells like in Excel, so it will show a "yes" or "null" value on every row.
Column = VAR _condition1 = IF(CALCULATE(COUNT('Table (2)'[Case]),ALLEXCEPT('Table (2)','Table (2)'[Case],'Table (2)'[Drug])) > 1, 1, 0) VAR _condition2 = IF(IFERROR(VALUE(RIGHT('Table (2)'[Screen],1)),-1) = -1, 0, 1) RETURN IF(_condition1=1 || _condition2=1, "yes", "null")Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi Anonymous
You can add a column with below DAX. Modify table name per your need. Power BI does not support merging cells like in Excel, so it will show a "yes" or "null" value on every row.
Column =
VAR _condition1 = IF(CALCULATE(COUNT('Table (2)'[Case]),ALLEXCEPT('Table (2)','Table (2)'[Case],'Table (2)'[Drug])) > 1, 1, 0)
VAR _condition2 = IF(IFERROR(VALUE(RIGHT('Table (2)'[Screen],1)),-1) = -1, 0, 1)
RETURN
IF(_condition1=1 || _condition2=1, "yes", "null")
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
- Anonymous3 years agoNot applicable
Hello,
I am trying this out now and it is telling me "Too many arguments were passed to the COUNT function. The maximum argument count for the function is 1."
- v-jingzhang3 years ago
Community Support
Hi Anonymous
Did you miss the right parenthesis next to Case column?
IF(CALCULATE(COUNT('Table (2)'[Case]),ALLEXCEPT('Table (2)','Table (2)'[Case],'Table (2)'[Drug])) > 1, 1, 0)
Best Regards,
Community Support Team _ Jing