Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Unique Values with Multiple Conditions

Hi everyone,    I'm wondering if there is a way to group by unique values in one column and still conduct analysis on the other columns. Looking at the sample data below, I am trying to group by ca...
  • v-jingzhang's avatar
    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.